Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a C++ language please Submit your answers to the following questions in a word processing document that is compatible with Microsoft Word. The name

In a C++ language please

Submit your answers to the following questions in a word processing document that is compatible with Microsoft Word. The name of the file you submit should be XYLab3, where X and Y are your first and last initials.

Questions (50 points):

1. Compose an if statement that assigns the value 55 to the variable speed and assigns the value 75 to the variable rate if the variable time is greater than 21.

2. Compose an if statement that assigns 0 to the variable benefit and assigns 1 to the variable cost if the variable age is less than 49.

3. Compose an if/else statement that assigns 0 to the variable boost if the variable tone is less than 10, otherwise, it should assign 89 to the variable boost.

4. Write an if/else if statement that assigns Platinum, Gold, or Silver to a string variable named status depending on the value in a double variable named donation. Platinum status is awarded for donations over $10,000. Gold status is awarded for donations that are not more than $10,000 but are at least $5,000. Silver status is awarded for donations that are less than $5,000.

5. Compose an if/else statement that determines whether the value of the variable age is outside the range of 18 to 60. If the variable age contains a value that is outside this range, your code should display Invalid age. in the console window. Otherwise, it should display Valid age. in the console window.

Programming Exercise (50 points):

The Albatross Freight Company charges the following rates:

Package Weight

Rate per Pound

3 pounds or less

$1.50

Over 3 pounds but not more than 7 pounds

$3.25

Over 7 pounds but not more than 12 pounds

$5.15

Over 12 pounds

$7.45

Write a C++ console application that asks the user for the weight of the package they wish to ship and then displays the charges for shipping that package.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions