What email address or phone number would you like to use to sign in to Docs.com?
If you already have an account that you use with Office or other Microsoft services, enter it here.
Or sign in with:
Signing in allows you to download and like content, and it provides the authors analytical data about your interactions with their content.
Embed code for: Lab Exercise 6
Select a size
Version Authors , Student ID, email, Date V1.0 201 6 - 11-15 Deadline: 201 6-11-22, 12pm
E.g. Lab 6 _InternetStudent_20130103301_BenWang.zip
Please send emails with zip above to firstname.lastname@example.org , the email title should be “ Lab6+StudentID+Name ”, and you will receive an auto reply email , keep this auto reply email in safe.
To be familiar with the Visual Studio C++ 6.0 Tools
aTo get basic programming skills.
Operation System: Windows XP
Programming Language: C++
Textbook : Starting Out With C++ Early Objects, Tony Gaddis
T asks (After finish the following tasks, hand in Lab Reports, all source code, and snapshot of running results)
3.1 Task One
(1)Program 4-23, p211.
Try to run the program.
Add one branch ‘ d ’ , and output “ You entered D.\n ” .
(2) Program 4-25,p213
Add on branch 400, and output “ You entered 400.\n ” .
(3) Program 4-27,p216
In the else if (choice != 4) branch, add another switch inside it:
cout << "For how many months? ";
cin >> months;
// Set charges based on user input
case 5: charges = months * ADULT_RATE;
case 6: charges = months * CHILD_RATE;
// Display the monthly charges
cout << fixed << showpoint << setprecision(2);
cout << "The total charges are $" << charges << endl;
(4) Program 5-1,p244
The ++ operator increases its operand’s value by 1. The –operator decreases its operand’s value by 1.In both prefix and postfix mode, these operators add 1 to, or subtract 1 from, their operand.
Notice that there is no space between the name of the variable and the ++ or –– preceding it or following it.
Run the program, and try to explain the result.
Try the following statements as well:
a = b++;
cout << “ a = ” << a << “ , b= ” << b<<endl;
a = ++c;
cout << “ a = ” << a << “ , c= ” << c<<endl;
a = b--;
a = --c;
(5) Program 5-3, p265.
Use for loop to calculate the total from 1 to 100;