Monday, February 22, 2016

What is the screen output of the following code segment?






 

What is the screen output of the following code segment?

 

Explain the reasoning behind your answer.

 

 

#include <iostream>

using namespace std;

int main()

{

double Test1 = 70;

double Test2 = 80;

double Test3 = 84;

double Average = 0;

int NumberOfTests = 3;

Average = (Test1 + Test2 + Test3) / NumberOfTests;

if (Average >= 90)

{

cout << “Great job”;

cout << “Your average is: ” << Average;

}

else if (Average >= 80 || Average <=89)

{

cout << “Nice work”;

cout << “Your average is: ” << Average;

}

else

{

cout << “Your average is: ” << Average;

cout << “You will do better next time!”;

}

return 0;

 

}

 

2.

 

Explain the properties and limitations of integer and floating-point numbers.

 

3.

 

Explain nested branches and loops.

 

4.

 

Explain the fundamental principles of testing and debugging.

 

 

5.


Design a class named EmployeeRecord that holds an employee’s ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that defines the class and implements the mutator methods.What is an index of a vector or array?



6.

 

What are the legal index values?

 

7.

 

What is a bounds error?


8.

 

How many constructors can a class have?

 

9.

 

Can you have a class with no constructors?

 

10.

 

If a class has more than one constructor, which of them gets called?

 

11.

 

Describe and justify why it is important to work on program design prior to program implementation.

 

 

Give detailed examples and recommendations.

 

12.

 

 

Describe what is an array. Provide examples and uses in Visual Basic & C# languages.

 

13.

 

Explain how to derive New Classes from Base Classes. Provide examples and uses in Visual Basic & C# languages.

 

14.

 

Describe classes, including constructors, methods, data, value, and reference types. Provide examples and uses in Visual Basic & C# languages.

 

15.

 

Describe delegate types. Provide examples and uses in Visual Basic & C# languages.


Want to Get  an A+ Paper at an Affordable Price! Or Any Other Paper Similar To This!


images (5)

No comments:

Post a Comment