100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

COSC 1436 C++ ACTUAL Exam Questions and CORRECT Answers

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
23-02-2025
Written in
2024/2025

COSC 1436 C++ ACTUAL Exam Questions and CORRECT Answers printTodaysDate is a function that accepts no parameters and returns no value. Write a statement that calls printTodaysDate. - CORRECT ANSWER - printTodaysDate(); Write the definition of a function printDottedLine, which has no parameters and doesn't return anything. The function prints to standard output a single line (terminated by a new line character) consisting of 5 periods. - CORRECT ANSWER - 1. void printDottedLine(

Show more Read less
Institution
Cosc
Course
Cosc









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Cosc
Course
Cosc

Document information

Uploaded on
February 23, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COSC 1436 C++ ACTUAL Exam Questions
and CORRECT Answers
printTodaysDate is a function that accepts no parameters and returns no value.

Write a statement that calls printTodaysDate. - CORRECT ANSWER - printTodaysDate();


Write the definition of a function printDottedLine, which has no parameters and doesn't return
anything. The function prints to standard output a single line (terminated by a new line character)
consisting of 5 periods. - CORRECT ANSWER - 1. void printDottedLine()
2. {
3. cout<<"....."<<endl;
4. }


Write a statement that declares a prototype for a function printTodaysDate, which has no
parameters and doesn't return anything. - CORRECT ANSWER - void printTodaysDate();


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. -
CORRECT ANSWER - printErrorDescription(14);


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 printLarger, passing it sales1 and sales2. - CORRECT
ANSWER - printLarger(sales1, sales2);


Write a statement that declares a prototype for a function printErrorDescription, which has an int
parameter and returns nothing. - CORRECT ANSWER - void printErrorDescription(int);


Write a statement that declares a prototype for a function printLarger, which has two int
parameters and returns no value. - CORRECT ANSWER - void printLarger(int,int);

, Write the definition of a function printGrade, which has a char parameter and returns nothing.
The function prints on a line by itself the message string Grade: followed by the char parameter
(printed as a character) to standard output. Don't forget to put a new line character at the end of
your line.


Thus, if the value of the parameter is 'A', the function prints out Grade: A - CORRECT
ANSWER - 1. void printGrade(char c)
2. {
3. printf("Grade:%c\n",c);
4. }


Write the definition of a function printAttitude, which has an int parameter and returns nothing.
The function prints a message to standard output depending on the value of its parameter.


If the parameter equals 1, the function prints disagree
If the parameter equals 2, the function prints no opinion
If the parameter equals 3, the function prints agree
In the case of other values, the function does nothing.

Each message is printed on a line by itself. - CORRECT ANSWER - 1. void
printAttitude(int a)
2. {
3. switch(a)
4. {
5. case 1:cout<< "disagree"<<endl;break;
6. case 2:cout<< "no opinion"<<endl;break;
7. case 3:cout<< "agree"<<endl;break;
8. }
9. }

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
MGRADES Stanford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1123
Member since
2 year
Number of followers
104
Documents
68962
Last sold
9 hours ago
MGRADES (Stanford Top Brains)

Welcome to MGRADES Exams, practices and Study materials Just think of me as the plug you will refer to your friends Me and my team will always make sure you get the best value from the exams markets. I offer the best study and exam materials for a wide range of courses and units. Make your study sessions more efficient and effective. Dive in and discover all you need to excel in your academic journey!

3.8

178 reviews

5
76
4
31
3
47
2
9
1
15

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions