100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

CIS 115 A+ complete solution

Beoordeling
-
Verkocht
-
Pagina's
34
Cijfer
A+
Geüpload op
12-08-2024
Geschreven in
2024/2025

CIS 115 A+ complete solution

Instelling
CIS 115
Vak
CIS 115











Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
CIS 115
Vak
CIS 115

Documentinformatie

Geüpload op
12 augustus 2024
Aantal pagina's
34
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Voorbeeld van de inhoud

Cis 115

1. printTodaysDate();: printTodaysDate
is a function that accepts no parameters and returns no value.
Write a statement that calls printTodaysDate
.
2. void printDottedLine(){
cout<<" .... \n";
}: Write the definition of a function
printDottedLine
, which has no parameters and doesn't return anything.
The function prints a single line consisting of
5
periods (terminated by a new line character) .
3. void printTodaysDate();: Write a statement that declares a prototype for a func-
tion
printTodaysDate
, which has no parameters and doesn't return anything.
4. printErrorDescription(14);: printErrorDescription
is a function that accepts one
int
parameter and returns no value.
Write a statement that calls the function
printErrorDescription
, passing it the value
14
.
5. printLarger(sales1,sales2);: printLarger
is a function that accepts two
int
parameters and returns no value.
Two
int
variables,
sales1
and
sales2
, have already been declared and initialized.
Write a
statement
that calls


, Cis 115

printLarger
, passing it
sales1
and
sales2
.
6. void printLarger(int one,int two){
if(one>two)
cout<<one<<endl;
else
cout<<two<<endl;
}: Write the definition of a function
printLarger
, which has two
int
parameters and returns nothing. The function prints the larger value of the two
parameters on a single line by itself. (For purposes of this exercise, the "larger"
means "not the smaller".)
7. int add(int,int);: Write a statement that declares a prototype for a function named
add
which has two
int
parameters and returns an
int
.
8. eurasiaSales=add(asiaSales,euroSales);: add
is a function that accepts two
int
arguments and returns their sum.
Two
int
variables,
euroSales
and
asiaSales
, have already been declared and initialized. Another
int
variable,
eurasiaSales


, Cis 115

, has already been declared.
Write a statement that calls the
add
function to compute the sum of
euroSales
and
asiaSales
and store this value in
eurasiaSales
.
9. int oneLess(int amount){
return amount-1;
}: Write the definition of a function named
oneLess
, which receives an
int
argument and returns an
int
that is one less than the value of the argument. So if the argument's value is
7
, the function returns the value
6
. If the argument's value happens to be
44
, the functions returns the value
43
10. int half(int amount){
return amount/2;

}: Write the
definition
of a function named
half
, which receives an integer argument and returns an integer that is
half
the value of the parameter. (Use integer division!)
So if the argument's value is
7
, the function returns the value


, Cis 115

3
.
If the argument's value happens to be
44
, the functions returns the value
22
.
11. bool isPositive(int num){
if(num>0){
return true;
}
else{
return false;

}
}: Write the definition of a function named isPositive, that receives an integer argu-
ment and returns true if the argument is positive, and false otherwise.

So, if the argument's value is 7 or 803 or 141 the function returns true.

But if the argument's value is -22 or -57, or 0, the function returns false
12. int counter(){
static int x=0;
return x++;
}: Write the definition of a function named
counter
that receives no parameters and returns
0
the first time it is invoked, returns
1
the next time it is invoked, then
2
,
3
and so on.
13. double timeOnHighway(double mileEndingPoint,
double mileStartingPoint=0.0, double speed=55.0){
return (mileEndingPoint-mileStartingPoint)/speed;
}: Write the definition of a function named
$3.49
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
sylvianthiwa
2.5
(2)

Ook beschikbaar in voordeelbundel

Thumbnail
Voordeelbundel
CIS 115 Week 1 iLab: Building a Registration Form and Pay Calculator in Python.
-
4 2024
$ 13.96 Meer info

Maak kennis met de verkoper

Seller avatar
sylvianthiwa Teachme2-tutor
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
6
Lid sinds
1 jaar
Aantal volgers
6
Documenten
577
Laatst verkocht
6 maanden geleden
A+ Nursing Guides

I understand how frustrating assignments can be. As a nurse, I have essential guides that have received A grades. I\'m a very friendly person and always happy to help.

2.5

2 beoordelingen

5
0
4
1
3
0
2
0
1
1

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen