Fill This Form To Receive Instant Help
Homework answers / question archive / 1) Write high-level and detailed pseudocode for a program that calculates the current balance in a bank account
1) Write high-level and detailed pseudocode for a program that calculates the current balance in a bank account. The program must ask the user for
Once the program calculates the current balance, it should be displayed on the screen.
2. The variable sum starts with the value 0.
Add 10 to sum.
Add 15 to sum.
Add 20 to sum.
Display the value of sum on the screen.
3. The variable x starts with the value 0.
The variable y starts with the value 5.
Add 1 to x.
Add 1 to y.
Add x and y, and store the result in y.
Display the value in y on the screen.
4. The variable j starts with the value 10.
The variable k starts with the value 2.
The variable l starts with the value 4.
Store the value of j times k in j.
Store the value of k times l in l.
Add j and l, and store the result in k.
Display the value in k on the screen.
5. The variable a starts with the value 1.
The variable b starts with the value 10.
The variable c starts with the value 100.
The variable x starts with the value 0.
Store the value c times 3 in x.
Add the value of b times 6 to the value already in x.
Add the value of a times 5 to the value already in x.
Display the value in x on the screen.
Chapter 2 -Problems 1 thru 20, 21, 22, 23, 25, 26, 27
cout << “Two mandolins like creatures in the” ;
cout << “dark” ;
cout << “Creating the agony of ecstasy.” ;
coutt << “ - George Barker”;
cout << “L” << endl
<< “E” << endl
<< “A”<< endl
<< “F” << endl;
21. Create detailed pseudocode for a program that calculates how many days are left
until Christmas , when given as an input how many weeks are left until Christmas.
Use variables named weeks and days.
22. Create detailed pseudocode for a program that determines how many full 12-egg
cartons of eggs a farmer can pack when given as an input the number of eggs he has
collected on a given day. Use variables named eggs and cartons.
23. Create detailed pseudocode for a program that determines distance traveled when
given inputs of speed and time. Use variables named speed, time, and distance.
24. What will the following programs print on the screen?
A) #include <iostream>
using namespace std;
int main ()
{
int freeze = 32, boil =
freeze = O;
boil = 10 0;
212· '
cout << freeze << endl << boil << endl;
return O;
}
B) #include <iostream>
using namespace std;
int main ( )
{
}
int x = O, y = 2;
x = y * 4;
cout << x << endl << y << endl;
return O;
C) #include <iostream>
using namespace std;
int main ( )
{
}
cout
cout
<< ''I am the incredible '' ;
<< '' computing\nmachine '';
cout << '' \nand I will \namaze \n '';
cout << ''you. \n '';
return O;
25.
A) #include <iostream>
using namespace std;
int main ( )
{
}
cout << ''Be careful! \n '';
cout << ''This might/n be a trick '';
cout << ''question. \n '';
return O;
B) #include <iostream>
using namespace std;
int main ( )
{
}
int a, x = 23;
a = x % 2;
cout << x << endl << a << endl;
return O;
26. The following program contains syntax errors. Locate as many as you can.
*/ What 's wrong with this program? /*
#include iostream
using namespace std;
int main ( ) ;
} int a, b, c \\ Three integers
a = 3
b = 4
c = a + b
Cout < ''The value of c is %d '' < C;
return O;
{