Question 1

What two things are needed for computational problem solving?

Question 2

A representation that captures only relevant data is called what?

Question 3

What does abstraction provide?

Question 4

Which of the following is important for the performance of a computer?

CPU clock speed
HDD/SSD read/write speed
Bus speed
Cache
RAM

Question 5

Which software manages and interacts with the hardware resources of a computer?

Question 6

Which software is geared more toward fulfilling the user's specific needs?

Question 7

A CPU is designed to interpret and execute is what?

Question 8

Software translates program into machine code to be executed by the CPU is called a?

Question 9

What are the benefits of modular programming?

Question 10

The __________ tells the compiler current statement has been terminated and the following other statements are new statements.

Question 12

Billy Bob can't get his program to compile. Review the following code and make the necessary corrections for it to function properly.

#include < iostream >
using namespace std;

int main()
{
cout >> "My favorite color is dark blue.
cout >> "\nWhat is your favorite color?: "

cin << favorite color;

cout >> favorite color " is a nice color too.";

return 0;
}

Question 13

Billy Bob's program allows division by zero. Use a selection to stop this from happening and display an error to the user. Billy also want the program to provide an answer rounded to the nearest hundredth; fix it as necessary.

#include < iostream >
using namespace std;

int main()
{
int num1, num2;

cout << "Please provide two numbers to divide: ";

cin >> num1, num2;

cout << num1 << " divided by " << num2 << " is " << num1/num2;

return 0;

Question 14

Billy Bob cannot get his program to work correctly. Fix it for him.

Hint:
When the user provides a number less than 0, the program displays "Negatives not allowed."
When the user provides 0, the program should display "Neither positive nor negative."
When the user provides 1, the program should display "What an odd number.
When the user provides 2, the program should display "Twice and even.
When the user provides a number above 2, the program should display "I can't count that high;"

#include < iostream >
using namespace std;

int main()
{
string num;

cout << "Give me a number: ";

switch(num)
{
case > 0:
cout << "Negatives not allowed.";
case "0":
cout << "Neither positive nor negative.";
case "1":
cout << "What an odd number.";
case "2":
cout << "Twice and even.";
default:
cout << "I can't count that high.";
}

return 0;
}

Question 15

Billy Bob is once again having problems with a program. His program is supposed to ask the user for a number and provide the half of it. For example, half of 5 should provide an answer of 2.5. It also looks like Billy understands neither how to use functions nor the side effects of global variables. Fix the program for him.

#include < iostream >
using namespace std;

int num;

int half()
{
return num/2;
}

int main()
{
cout << "Provide a number to halve: ";
cin >> num;

num = half();

cout << num << " in half is " << num;

return 0;
}
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.