Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXTest 2 Test 2 – Chapter 3-6 and 17 This test covers the first 11 weeks of class, which covers chapter 3, 4, 5, 6 and 17 with an emphasis...

1 answer below »
CITP 3310 XXXXXXXXXXSurvey of Programming Languages XXXXXXXXXXTest 2

Test 2 – Chapter 3-6 and 17
This test covers the first 11 weeks of class, which covers chapter 3, 4, 5, 6 and 17 with an emphasis on
chapters 4-6.
YOUR PROGRAM
An International Internet phone company has three different subscription packages for its customers:


Package A:
For $9.95 per month 5 hours of call time are provided. Additional usage costs
$0.08 per minute.
Package B:
For $14.95 per month 10 hours of call time are provided. Additional usage costs
$0.06 per minute.
Package C: For $19.95 per month unlimited call time is provided.
Write a program in C# that calculates a customer's monthly bill. It should ask the user to enter the
customer name, which package the customer has purchased, and how many hours were used. The
program should then create a bill (format it like bill) that includes the input information and the total
amount due. Wherever possible, use named constants instead of numbers. Display bill on screen.
Input Validation: Be sure the user only selects package A, B, or C.
The program should also display how much money Package A customers would save if they purchases
packages B or C, and how much money package B customers would save if they purchases package C.
(Use a switch statement for this) If there would be no savings, no message should be printed.
The user will get the option to try again (Try again? ‘Y’/’N’). If they enter ‘N’, the program will stop,
while if they enter ‘Y’, the program will start from the beginning.
When they enter ‘N’, the program will print out the formatted bill to a file called “MyBill.txt”.
When you are done, you will submit the .cs file via Blackboard.
Answered Same Day Jul 11, 2021

Solution

Aditya answered on Jul 12 2021
148 Votes
using System;
using System.IO;
namespace PhoneBilling
{
class Program
{
static void Main(string[] args)
{
string contactName;
float hours;
string package;
float amount = 0;
string repeat = "Y";
do
{

Console.WriteLine("Enter customer name");
contactName = Console.ReadLine();
Console.WriteLine("Enter the package");
while (true)
{
package = Console.ReadLine();
if ((package == "A") || (package == "B") || (package == "C"))
{

eak;
}
else
{
Console.WriteLine("Wrong Package. Package can only be A,B and C. Enter Package again");
}
}
Console.WriteLine("Enter number of hours");
hours = float.Parse(Console.ReadLine());
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here