Question

Need to a program in Java using if statements. Suppose the WIFI of a client is...

Need to a program in Java using if statements.

Suppose the WIFI of a client is not working and you were assigned to troubleshoot it. For your efforts, suppose you will be paid $20 for every action you take to try to fix it (regardless if the action taken fixes the problem or not). You will also need to ask the customer for a $10 deposit before you start your work. At the end of the troubleshooting process, the client will hand your payment (minus the deposit).

Using what you have learned in the lectures, create a flow chart with the logic needed to solve the problem.

Your flow chart must also:

  • Have at least 3 troubleshooting actions (e.g. plug in the router, etc.)
  • Have at least 3 checks to verify if a corresponding action fixed the problem or not (e.g. did plugging in the router solved the problem?).
  • Must show, at the end, the total amount to be paid for your services (you must use a variable and update it accordingly each time an action is performed).
  1. At the end of the program, you will ask if the client wants to purchase a regular router for $50 or a super high-speed router for $200, adding the cost to the total amount the client needs to pay.
  2. Once your program calculates the final bill amount, it needs to ask if the client is a member of the military. If so, your program should reduce by 10% the total amount the client needs to pay.
  3. Finally, your program must print on the screen the final bill amount to pay, together with the amount reduced for a military discount if applicable (e.g. if the total amount for a military client was $220, your program must show something like this: "Your total bill is $198. This includes a $22 military discount").

Homework Answers

Answer #1

Wrote the java code for you, any further doubts ask in comments:

/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.


*******************************************************************************/
import java.util.Scanner; 
public class Main
{
        public static void main(String[] args) {
        //      System.out.println("Hello World");
        int deposit=10;
        double money=0;
        int tries=3;
        while(tries>0){
            //troubleshooting process done
        money+=20;
        tries--;
        }
        money-=deposit;
        System.out.format("Amount needed for services: %.2f\n",money);
        //ask client
        System.out.println("Press 1 for regular and 2 for high speed router");
        Scanner sc= new Scanner(System.in);
        int router_type=sc.nextInt();
        
        if(router_type==1) money+=50;
        else if(router_type==2) money+=200;
        
        System.out.println("Are you in the military? y/n");
        //Scanner sc= new Scanner(System.in);
        char is_military=sc.next().charAt(0);
        
        if(is_military=='y'){
            double mil_disc=(money*0.1);
            money-=mil_disc;
            System.out.format("The total amount you need to pay is %.2f$. You have military discount of %.2f$\n",money,mil_disc);
        } 
        else if(is_military=='n'){
            System.out.format("The total amount you need to pay is %.2f$\n",money);
        }
        }
        
}
Know the answer?
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
Similar Questions
Create a program in java using if statements Suppose the WIFI of a client is not...
Create a program in java using if statements Suppose the WIFI of a client is not working and you were assigned to troubleshoot it. For your efforts, suppose you will be paid $20 for every action you take to try to fix it (regardless if the action taken fixes the problem or not). You will also need to ask the customer for a $10 deposit before you start your work. At the end of the troubleshooting process, the client will...
Goal: Design and build a simple cash register program in C++ using the programming constructs included...
Goal: Design and build a simple cash register program in C++ using the programming constructs included (simple expressions, a loop, and if statements). Problem: A company needs a cash register program to work on their new computer system. The program should first ask whether the payment is in cash and credit card. If it is a credit card transaction, you must get the card pin. The program will then read in a number of prices to read, finally it must...
For this assignment, you need to submit a Python program that gathers the following employee information...
For this assignment, you need to submit a Python program that gathers the following employee information according to the rules provided: Employee ID (this is required, and must be a number that is 7 or less digits long) Employee Name (this is required, and must be comprised of primarily upper and lower case letters. Spaces, the ' and - character are all allowed as well. Employee Email Address (this is required, and must be comprised of primarily of alphanumeric characters....
Need this in C#. Revisit the program you developed for Problem 1 of Assignment 2. Now,...
Need this in C#. Revisit the program you developed for Problem 1 of Assignment 2. Now, you need to satisfy the following additional requirement. If the user enters a number out of range (e.g., non-positive value), the program displays a warning message about the invalid. The program keeps displaying the warning message until the user enters valid inputs. Use loop statement(s). Here is my code for Problem1 of Assignment 2: using System; namespace Assignment2Problem1 { class Program { static void...
Create in JAVA Suppose you are designing a game called King of the Stacks. The rules...
Create in JAVA Suppose you are designing a game called King of the Stacks. The rules of the game are as follows:  The game is played with two (2) players.  There are three (3) different Stacks in the game.  Each turn, a player pushes a disk on top of exactly one of the three Stacks. Players alternate turns throughout the game. Each disk will include some marker to denote to whom it belongs.  At the end...
--USING C# ONLY-- You will create your own on-line shopping store in the console application. You...
--USING C# ONLY-- You will create your own on-line shopping store in the console application. You can choose different products to sell in your store (at least 8 products). You will create an product inventory text file. The program will display two options at the beginning of the program, Customer and Manager. Customer: If this is a new customer, the program will allow the customer to register with their information and assign a unique ID number to the new customer....
A) A client just deposited ¢7,000,000 in one of your investment funds which is currently earning...
A) A client just deposited ¢7,000,000 in one of your investment funds which is currently earning 10% return. The bank has advised the client to deposit an additional ¢4,000,000 at the end of each of the next three years. The client would like to know how much the total amount in this investment will be in three years’ time. Kassim has just been offered a job at ¢600,000 a year. He anticipates his salary will increase by 6% annually until...
Please program in JAVA: Program each option such as delete line and such. Your program will...
Please program in JAVA: Program each option such as delete line and such. Your program will be a line editor. A line editor is an editor where all operations are performed by entering commands at the command line. Commands include displaying lines, inserting text, editing lines, cutting and pasting text, loading and saving files. For example, a session where the user enters three lines of text and saves them as a new file may appear as: Menu: m Delete line:...
4) Write a java program where you will use while loop, where if condition is equal...
4) Write a java program where you will use while loop, where if condition is equal to 2 (or any other choice of your number) then it will break the while condition. Steps: 1) Declare variable int (any name) which is equal to zero 2) Declare while condition which variable int is less then equal to 10 3) Declare print out where the value of variable is the same name that you declared in step 1 4) Declare condition if...
please can you make it simple. For example using scanner or hard coding when it is...
please can you make it simple. For example using scanner or hard coding when it is a good idea instead of arrays and that stuff.Please just make one program (or class) and explain step by step. Also it was given to me a txt.htm 1.- Write a client program and a server program to implement the following simplified HTTP protocol based on TCP service. Please make sure your program supports multiple clients. The webpage file CS3700.htm is provided. You may...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT