Question

write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different...

write in C++

Problem 1: Mobile Service Provider

A cell phone service provider has three different subscription packages for its customers.

Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute.
Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute.
Package C: For $69.99 per month unlimited minutes provided.

Write a program that calculates a customer’s monthly bill. It should ask which package the customer has purchased and how many minutes were used. It should then display the total amount due. Print out "Invalid Package!" if a package other than A, B, or C is entered. Print out "Invalid Minutes!" if negative minutes are entered.

Problem 2: Output Numbers from 1 to N

Write a program that prints out every other number between 1 and N where N is entered by the user. The numbers must be separated by a comma and a space. The last number must not have a comma following it. The program is repeated until a number smaller than 1 is entered at which point the program outputs "Goodbye!"

Example:
Enter N: 7
1, 3, 5, 7
Enter N: 10
1, 3, 5, 7, 9
Enter N: -1
Goodbye!

Problem 3: Inferred Numbers

The following formula produces a sequence of numbers. It starts out with three initial whole numbers a, b, and c. Each following number is represented by multiplying a and b and dividing the result by c. The sequence ends once it reaches zero. For example, an initial set of 3, 4, and 5 would produce a sequence of: 3, 4, 5, 2, 10, 1, 20, 0

Write a program that prompts the user to enter three integers. The program then uses a loop to continuously compute the next integer based on the three previous integers according to the aforementioned formula.

1 0
Add a comment Improve this question Transcribed image text
Answer #1

Problem 1: Mobile Service Provider

#include<iostream>

using namespace std;


int main()
{
float cost;
char ch;
int mintues;
cout<<"Enter package you have purchased(type A, B or C): ";
cin>>ch;

cout<<"Enter how many mintues were used: ";
cin>>mintues;

if(ch=='A')
{
   if(mintues<0)
   {
       cout<<"Invalid Minutes!\n";
   }
   else if(mintues<=450)
   {
       cost=39.99;
       cout<<"Cost is: "<<cost;
   }
   else
   {
       cost=39.99+(mintues-450)*0.45;
       cout<<"Cost is: "<<cost;
   }
  
}
else if(ch=='B')
{
   if(mintues<0)
   {
       cout<<"Invalid Minutes!\n";
   }
   else if(mintues<=900)
   {
       cost=59.99;
       cout<<"Cost is: "<<cost;  
   }
   else
   {
       cost=59.99+(mintues-900)*0.40;
       cout<<"Cost is: "<<cost;
   }
}
else if(ch=='C')
{
   if(mintues<0)
   {
       cout<<"Invalid Minutes!\n";
   }
   else
   {
           cost=69.99;
           cout<<"Cost is: "<<cost;
   }

  
}
else
{
   cout<<"Invalid Package!\n";
}

return 0;
}

Add a comment
Know the answer?
Add Answer to:
write in C++ Problem 1: Mobile Service Provider A cell phone service provider has three different...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Part 1: A mobile phone service provider has three different data plans for its customers: Package...

    Part 1: A mobile phone service provider has three different data plans for its customers: Package A: For $39.99 per month 4 gigabytes are provided. Additional data costs $10 per gigabyte. Package B: For $59.99 per month, 8 gigabytes are provided. Additional data costs $5 per gigabyte. Package C: For $69.99 per month, unlimited data is provided. Write a program that calculates a customer's monthly bill. It should ask which package the customer has purchased and how many gigabytes were...

  • Java Programming Problem description with its major requirements labeled from A to I. A mobile phone...

    Java Programming Problem description with its major requirements labeled from A to I. A mobile phone service provider has three different subscription packages for its customers: Package A: For $39.99 per month 450 minutes are provided. Additional minutes are $0.45 per minute. Package B: For $59.99 per month 900 minutes are provided. Additional minutes are $0.40 per minute. Package C: For $69.99 per month unlimited minutes are provided. Design a class MobileCharges that calculates a customer’s monthly bill. It should...

  • Problem: Mobile Service Provider A mobile service provider has three different subscription packages for its customers:...

    Problem: Mobile Service Provider A mobile service provider has three different subscription packages for its customers: • Package A: For $50 per month, 5 GB data are provided. Additional data is $15 per GB. • Package B: For $65 per month, 10 data are provided. Additional data is $10 per GB. • Package C: For $75 per month unlimited data provided. Text messaging and voice services are included in all of the company's data packages. The Mobile Service Company offers...

  • write in java and you must use methods.... Part I     Internet Service Provider An Internet service...

    write in java and you must use methods.... Part I     Internet Service Provider An Internet service 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. Package B: For $13.95 per month 20 hours of access are provided. Additional hours are $1.00 per hour. Package C: For $19.95 per month unlimited access is provided. Write a program that calculates a customer’s monthly bill....

  • In PYTHON code: Examples of output are as follows: If the user entered Package A and...

    In PYTHON code: Examples of output are as follows: If the user entered Package A and 30 GB of data, then you should get the following output: Mobile Service Provider Enter your mobile phone package (A, B or C): A How many gigabytes data did you use? 30 Your total cost for Package A is 299.99 If you had chosen Package C you would have saved $ 230.00 If you had chosen Package B you would have saved $ 130.00...

  • A friend of yours is considering two cell phone service providers. Provider A charges $100 per...

    A friend of yours is considering two cell phone service providers. Provider A charges $100 per month for the service regardless of the number of phone calls made. Provider B does not have a fixed service fee but instead charges $1 per minute for calls. Your friend's monthly demand for minutes of calling is given by the equation QD=120−30P QD=120−30P, where P is the price of a minute. 1. With Provider A, the cost of an extra minute is ?...

  • An Internet service provider has three different subscription packages for its customers: Package A: For $15...

    An Internet service provider has three different subscription packages for its customers: Package A: For $15 per month with 50 hours of access provided. Additional hours are $2.00 per hour over 50 hours. Assume usage is recorded in one-hour increments. Package B: For $20 per month with 100 hours of access provided. Additional hours are $1.50 per hour over 100 hours. Package C: For $25 per month with 150 hours access is provided.    Additional hours are $1.00 per hour...

  • C++ Write a program that asks user to input three positive integers one at a time,...

    C++ Write a program that asks user to input three positive integers one at a time, then compute and output the largest entered number. Use if-else statements for three integer comparison and use for loops for a user validation. Example output: Enter an integer: -7 Invalid! Number must be positive. Enter an integer: -2 Invalid! Number must be positive. Enter an integer: 5 Enter an integer: 7 Enter an integer: 1 Largest number: 7

  • Problem 1: Write a program that reads a positive float number and displays the previous and...

    Problem 1: Write a program that reads a positive float number and displays the previous and next integers. Sample Run: Enter a float: 3.5 The previous and next integers are 3 and 4. Problem 2: Write a program that reads two integers and displays their sum, difference, product, and the result of their division. Sample Run: Enter two integers: 8 5 Sum: 8, Difference: 3, Product: 40, Division: 1.6 Problem 3: Write a program that reads a three-digit integer from...

  • Write in C++ program Larger than n In a program, write a function that accepts three...

    Write in C++ program Larger than n In a program, write a function that accepts three arguments: an array, the size of the array, and a number n. Assume the array contains integers. The function should display all of the numbers in the array that are greater than the number n. Input from the keyboard: The filename and path of a list of integer numbers.                                           The number n to test the file numbers. Output to the console: The...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT