Need help with C++ programming work

Hi, I'm new to programming and I'm doing a course in uni. I'm currently using "Dev-C++". I've been away on holidays and haven't been able to grasp the work we're doing now. I would really appreciate it if any of you C++ programming geniuses helped me with my work as I'm in a troubling situation with no idea what to do. If anyone is so helpful enough to help me with some of the questions or as much as you can then I will be so grateful. I will use this help to learn and understand more about C++ but for now I just need help on these questions.
Thanks.


Q.1

Option A
Using parentheses, rewrite the following expression to indicate the correct order of evaluation. Then evaluate the expression, assuming a=5, b=2, and c=4.

a % b * c && c % b * a

Option B
Determine the value of the following expression, assuming a=5, b=2, c=4, and d=5.

d % b * c > 5 || c % b * d < 7

Option C
Using parentheses, rewrite the following expression to indicate the correct order of evaluation. Then evaluate the expression, assuming a=5, b=2, and c=4.

b % c * a || a % c * b


Q.2
Option A
Write a C++ program to compute and display a person's weekly salary as determined by the following expressions:

If the number of hours worked is less than or equal to 40, the person receives $8.00 per hour; otherwise, the person receives $320.00, plus $12.00 for each hour worked over 40 hours.

The program should request the hours worked as input and should display the salary as output.

Option B
Write a C++ program that accepts a character using the cin object and determines whether the character is a lowercase letter. A lowercase letter is any character that is greater than or equal to 'a' and less than or equal to 'z'. If the entered character is a lowercase letter, display the mssage The character just entered is a lowercase letter. If the entered letter is not lowercase, display the message The character just entered is not a lowercase letter.


Q.3

This question is in regard to the C++ program

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
double monthlySales, income;

cout << "Enter the value of monthly sales: ";
cin >> monthlySales;
if (monthlySales >= 50000.00)
income = 375.00 + .16 * monthlySales;
if (monthlySales >= 40000.00 && monthlySales < 50000.00)
income = 350.00 + .14 * monthlySales;

// simplified here from the one in the textbook
if (monthlySales < 40000.00)
income = 200.00 + .03 * monthlySales;

cout << "\n\n\The income is $" << income << endl;

return 0;
}

and the C++ program

#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
double monthlySales, income;

cout << "Enter the value of monthly sales: ";
cin >> monthlySales;

if (monthlySales >= 50000.00)
income = 375.00 + .16 * monthlySales;
else if (monthlySales >= 40000.00)
income = 350.00 + .14 * monthlySales;

// simplified here from the one in the textbook
else
income = 200.00 + .03 * monthlySales;

cout << "The income is $" << income << endl;

return 0;
}

Option A

Will these two programs produce the same output?
Which program is better? Why?
Draw the flow chart for the first C++ program.

Option B

Will these two program produce the same output?
Which program is better? Why?
Draw the flow chart for the second C++ program.


Q.4

Option A, B
For the following C++ program

#include <iostream>
using namespace std;

int main()
{
int num = 0;
while (num <= 20)
{
num++;
cout << num << " ";
}

return 0;
}

determine the total number of items displayed, and the first and last numbers printed. Draw the flow chart for the C++ program, and then desk-check the program for the first 5 steps and the last 3.
Read your textbook.
I was just browsing CodeGuru and found this exact same post, so I decided to Google it. All I have to say is WOW!!! The amount of message boards you registered to and asked this question on is just UNBELIEVABLE!! Seriously.. you could have easily read your textbook, learned the material, and coded this yourself in half the time I'm sure it took to register and post all this.

http://www.google.com/#sclient=psy&hl=en&q=If+the+number+of+hours+worked+is+less+than+or+equal+to+40%2C+the+person+receives+%248.00+per+hour%3B+otherwise%2C+the+person+receives+%24320.00%2C+plus+%2412.00+for+each+hour+worked+over+40+hours.&aq=f&aqi=&aql=&oq=&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=384aef4afa8e1652Google Link
Made me laugh a little..
Last edited on
Now THAT is entertaining!
Wow. Maybe some of those are content farms, though.
Might be a whole class full of students, too.
Topic archived. No new replies allowed.