Question

- w each bill. Design a flowchart or pseudocode for the following: A program that accepts the following data about one custom please use flowgorithm program to do the flowchrat.



6. The Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as those are the data that are in the question.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

package lecture;
import java.util.*;
public class MessageCharge {

   public static void main(String[] args) {
       // TODO Auto-generated method stub

while(true)
{
   System.out.println("enter the three digit area code(-1) to exit: ");
Scanner sc=new Scanner(System.in);
int areacode=sc.nextInt();
   if(areacode<0)
   {
   System.out.println("Now exiting the code ");
   System.exit(0);
   }     
int count=0,r,ph,charge1=0,charge2=0,charge3=0,messagecount1;
int tempareacode=areacode;

       while(tempareacode>0)
       {
           r=tempareacode%10;
           count++;
           tempareacode=tempareacode/10;
       }

       if(count!=3)
           System.out.println("wrong areacode(not three digit) re-enter all data please ");
       else
       {
           count=0;
           System.out.println("enter your seven digit phone number: ");
           ph=sc.nextInt();
           int tempph=ph;
           while(tempph>0)
               {
               r=tempph%10;
               count++;
               tempph=tempph/10;
               }
               if(count!=7)
           System.out.println("wrong mobile number(not seven digit)re-enter all data please ");
               else
               {
                   System.out.println("enter the number of text messages sent: ");
                   int messagecount=sc.nextInt();
                   if(messagecount>300)
                   {
                       messagecount1=messagecount-300;
                       charge1=messagecount1*2;
                       charge2=199*3;
                       charge3=500;
                   }
                   else if(messagecount>100 && messagecount<=300)
                   {
                       messagecount1=messagecount-100;
                       charge1=messagecount1*3;
                       charge2=500;
                   }
                   else
                   {
                       charge1=500;
                   }
                   double amountpaid=charge1+charge2+charge3;
                   double dollar=((int)amountpaid)/100;
                   double cent=amountpaid%100;
                  
                   System.out.println("---------before tax-----------");
                   if(dollar>=1)
                   {
                       System.out.print("dollar: "+dollar);
                       System.out.println(" cent: "+Math.round(cent));
                   }
                   else
                   {
                       System.out.println(" cent: "+Math.round(cent));
                   }
                   System.out.println("------------after tax--------- ");
                   double tax=(amountpaid*14)/100;
                   amountpaid=amountpaid+tax;
                   dollar=(int)amountpaid/100;
                   cent=amountpaid%100;
                   if(dollar>=1)
                   {
                       System.out.print("dollar: "+dollar);
                       System.out.println(" cent: "+Math.round(cent));
                   }
                   else
                   {
                       System.out.println(" cent: "+Math.round(cent));
                   }
      
               }
       }
     


}
   }

}

enter the three digit area code(-1) to exit: 121 enter your seven digit phone number: 1234567 enter the number of text messag

FLOWGORITHM FOR MAIN LOGIC OF PROGRAM

SAC false мм 5100 & <=300 charger msg count! = msg count-300 chargel = husg comf 1*2; charge 2 = 199*3; charge 3 = 500 messag

DON'T FORGET TO LIKE.

THANKS BY HEART.

Add a comment
Know the answer?
Add Answer to:
please use flowgorithm program to do the flowchrat. those are the data that are in the...
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
  • You will create flowchart using Flowgorithm and Pseudocode for the following program example:&nbs...

    you will create flowchart using Flowgorithm and Pseudocode for the following program example:   Pet Care is a doggy day care that would like you to create a program that accepts the dog owner's name pet's name, breed, age and weight of the dog. The program should allow the user to enter this data until a sentinel value is reached. Then it will display the dog's name if the dog weighs less than 20 pounds or more than 100 pounds (be...

  • CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50...

    CIST 1305 – Program Design and Development Chapter 4 Assignment #7 [Decisions/If Statements & Loops] (50 Points) Please do the following exercises: Pastoral College is a small college in the Midwest. Design the pseudo-code for a program that accepts a student name, major field of study, and grade point average. Display a student’s data with the message “Dean’s list” if the student’s grade point average is above 3.5, “Academic probation” if the grade point average is below 2.0, and no...

  • The following program MUST be written in Flowgorithm and MUST use modules. Could someone please add...

    The following program MUST be written in Flowgorithm and MUST use modules. Could someone please add screenshots to show me how this is supposed to look in Flowgorithm? I'm confused as to how to break it up into extra functions. For the programming problem, create the flowchart and enter it into the Flowgorithm program to test the accuracy of your logic. Save the file as Ch7Lab1. Payroll Program with Input Validation Design a payroll program that prompts the user to...

  • finite mathematics an applied approach 11th edition, Sullivan, Chp 2, project page 101. // Should be in the book souliti...

    finite mathematics an applied approach 11th edition, Sullivan, Chp 2, project page 101. // Should be in the book soulitions but can't find it. 1. You decide to compare the basic charges for two cell phone plans that include texting and Web access. Here are the monthly costs for two plans.* Plan A includes a flat rate of $39.99 for 450 anytime minutes plus $.02 for each text message (sent or received) and $1.99 per megabyte of data usage (50...

  • Programming Concepts CS 225 for C++ To make telephone numbers easier to remember, some companies use...

    Programming Concepts CS 225 for C++ To make telephone numbers easier to remember, some companies use digits and letters (or only letters) to show their telephone number. In some cases, to make a telephone number meaningful, companies might use more than seven digits and letters. Here are some examples: Phone Number in Display Note Actual Phone Number GET LOAN - 438-5626 CALL HOME More than seven digits/letters used for ease of remembrance. 225-5466 111 GOLD - 111-4653 Glass4u - 452-7748...

  • 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...

  • 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...

  • Flowchart for Python program: Design and create a program for the ULM Coffee Shop to provide...

    Flowchart for Python program: Design and create a program for the ULM Coffee Shop to provide some customer market research data. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more...

  • Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its...

    Conditional Statements in C++ 1. Your company has decided to offer a rewards program for its loyal customers. The rewards program offers three levels, Gold(G), Silver(S), and Bronze(B). Discounts on the customer’s sales receipt are provided in the table below along with additional discounts for only the amount of the purchase over $200.00. A maximum discount amount for any purchase is $30.00. Your program should prompt the user for their current reward level and sales receipt amount. Based on the...

  • C++ with Pseudocode in the beginning This assignment will require you to write a program that...

    C++ with Pseudocode in the beginning This assignment will require you to write a program that will create an array of 10 string objects. The array will be initialized with the strings which contain the person’s name and phone number in one string. The following is an example of test data: “Renee Javens, 678-1223”, “Joe Looney, 586-0097”, “Geri Palmer, 223-8787”, “Lynn Presnell, 887-1212”, “Bill Wolfe, 223-8878”, “Sam Wiggins, 486-0998”, “Bob Kain, 586-8712”, “Tim Haynes, 586-7676”, “John Johnson, 223-9037”, “Jean James,...

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