Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help for c++ So far i have this code that works #include using namespace std; int main() { char package, month; double hours, total;

need help for c++

So far i have this code that works

#include

using namespace std; int main() { char package, month; double hours, total;

cout > hours; cout > package; if (hours > 0 && hours

switch(package) { case 'a': case 'A': if (hours > 10) { total = (hours - 10) * 2 + 9.95; cout 20) { total = (hours - 20) * 1 + 14.95; cout

}

but when i try to add anything about having the user input the month for which they are using the code doesn't work properly.

It just runs through all the code without letting the user enter input which package number and hours they used

for example if i change

cout >hours;

to

cout > month>>hours;

after adding a char month variable it wont work properlyimage text in transcribed

Problem An cell phone provider has three different subscription packages for its customers Package A: For $9.95 per month 10 hours of access are provided. Additional hours are $2.00 per hour. For $14.95 per month 20 hours of access are provided. Additional hours are $1.00 per Package B: hour Package C: For $19.95 per unlimited access is provided Write a program to ask which package the customer has purchased, what month they are using and how many hours were used Determine maxHours, Months with 30 days have 720 hours, and months with 31 days have 744 hours February, with 28 days, has 672 hours Month January February March April June July August September October November December Input validation: Be sure the user only selects package A, B, or C. Also, the number of hours used in a month cannot exceed maxHours (or be less than 0) Days 31 28 31 30 31 30 31 31 30 31 30 31 Hours 744 672 744 720 744 720 744 744 720 744 720 744 Display the charge for the Package chosen Display how much money Package A customers would save if they purchased packages B or C; how much money Package B customers would save if they purchased packages A or C; and how much Package C customers would save if they purchased packages A or B If there would be no savings, no message should be printed

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

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

=+ (a) Extend to the case of bounded F.

Answered: 1 week ago

Question

5. List the forces that shape a groups decisions

Answered: 1 week ago

Question

4. Identify how culture affects appropriate leadership behavior

Answered: 1 week ago