Package deal
NIU CSCI 240 Exam Questions and Correct Verified Answers Latest Version
NIU CSCI 240 Exam Questions and Correct Verified Answers Latest Version
[Show more]NIU CSCI 240 Exam Questions and Correct Verified Answers Latest Version
[Show more]The data type char and the data type __________ are often interchageable in 
C++ 
 int 
What will happen if a char is cout'd as an int? 
 the ASCII value of the character will be displayed 
What is the ASCII value of the character '1'? 
 49 
What is the ASCII value of 'c'? 
 99 
Writ...
Preview 2 out of 8 pages
Add to cartThe data type char and the data type __________ are often interchageable in 
C++ 
 int 
What will happen if a char is cout'd as an int? 
 the ASCII value of the character will be displayed 
What is the ASCII value of the character '1'? 
 49 
What is the ASCII value of 'c'? 
 99 
Writ...
The class X contains two data members: an integer called xVal and a float 
called xPerc. Which of the following is NOT a valid prototype for the class 
definition for X? 
a. void X( int, float ); 
b. void setxVal( int ); 
c. float getxPerc(); 
d. X( int, float ); 
e. void printX(); 
 a. void X( in...
Preview 4 out of 34 pages
Add to cartThe class X contains two data members: an integer called xVal and a float 
called xPerc. Which of the following is NOT a valid prototype for the class 
definition for X? 
a. void X( int, float ); 
b. void setxVal( int ); 
c. float getxPerc(); 
d. X( int, float ); 
e. void printX(); 
 a. void X( in...
Write the constructor for the Time class. It takes three integer arguments: the 
potential hour, minute, and second values for the Time object. The 
constructor should pass the individual arguments to the setHour, setMinute, 
and setSecond methods to initialize the data members. 
 Time :: Time ( ...
Preview 2 out of 11 pages
Add to cartWrite the constructor for the Time class. It takes three integer arguments: the 
potential hour, minute, and second values for the Time object. The 
constructor should pass the individual arguments to the setHour, setMinute, 
and setSecond methods to initialize the data members. 
 Time :: Time ( ...
Write a complete function called calcTriArea that will calculate and return 
the area of a triangle. It takes two float/double values: the base and height 
as its arguments. The area of a triangle is one-half the base times the height. 
 double calcTriArea(double base, double height) 
 
 { 
 
 ret...
Preview 3 out of 16 pages
Add to cartWrite a complete function called calcTriArea that will calculate and return 
the area of a triangle. It takes two float/double values: the base and height 
as its arguments. The area of a triangle is one-half the base times the height. 
 double calcTriArea(double base, double height) 
 
 { 
 
 ret...
main() marks the beginning of a C++ program. What C++ reserved word 
precedes it? 
 int 
Most lines in a C++ program end with a 
 ; (semi-colon) 
According to the lecture notes, the two main conceptual components of a 
program are _____ and _____. 
 data and instructions 
Modify (rewrite) the foll...
Preview 3 out of 22 pages
Add to cartmain() marks the beginning of a C++ program. What C++ reserved word 
precedes it? 
 int 
Most lines in a C++ program end with a 
 ; (semi-colon) 
According to the lecture notes, the two main conceptual components of a 
program are _____ and _____. 
 data and instructions 
Modify (rewrite) the foll...
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Stuvia is a marketplace, so you are not buying this document from us, but from seller ExamArsenal. Stuvia facilitates payment to the seller.
No, you only buy these notes for $24.87. You're not tied to anything after your purchase.
4.6 stars on Google & Trustpilot (+1000 reviews)
79079 documents were sold in the last 30 days
Founded in 2010, the go-to place to buy study notes for 14 years now