1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergiy2304 [10]
3 years ago
6

Write a program that can be used to determine the tip amount that should be added to a restaurant charge. Allow the user to inpu

t the restaurant charge, before taxes. Produce output showing the calculated values including the total amount due for both 15% and the 20% tips. Tax of 9% should be added to the bill before the tip is determined. Write appropriate methods for your solution. Display subtotal showing the amount owed prior to applying a tip. Show each tip amount and the totals with each tip amount. Be sure to provide labels for values and number align them.
Computers and Technology
1 answer:
atroni [7]3 years ago
6 0

Answer:

using System;

public class Test

{

public static void Main()

{

// your code goes here

Console.Write("\nEnter the total bill : ");

double totalbeforetax = Convert.ToDouble(Console.ReadLine());

Console.Write("\nEnter the tip percentage(10% or 15%) : ");

double tip = Convert.ToDouble(Console.ReadLine());

double totalwithtax = totalbeforetax*(1+0.09);

double tipamount = tip*totalwithtax/100;

double total = totalwithtax + tipamount;

Console.WriteLine("\nTotal bill without tax: "+totalbeforetax);

Console.WriteLine("\nTotal bill with 9% tax: "+totalwithtax);

Console.WriteLine("\nTip Amount: "+tipamount);

Console.WriteLine("\nTotal bill with tax and tip: "+total);

}

}

Explanation:

You might be interested in
Required skills,training,education for dentist
AlekseyPX

Answer:

Education-Bachelor's degree prior to admission to dental school; doctoral degree in dental medicine or dental surgery; some dental specializations require completion of a residency

Skills- Communication skills. Dentists must have excellent communication skills, Detail oriented, Dexterity, Leadership skills, Organizational skills, Patience, Physical stamina, Problem-solving skills.

Explanation:

7 0
3 years ago
In the replace dialog box, clicking what button changes highlighted text
Andre45 [30]

ANSWER: Replace Button

EXPLANATION: After opening the replace dialog box and putting the desired values in the boxes, we need to click the 'Replace' button to change the highlighted text. If the word which needs to be changed appear multiple times in the document, then clicking on 'Replace All' is advised as it would change all the old words with the new ones.

7 0
3 years ago
Read 2 more answers
If you answer I will mark brainliest!!! I want to be able to see two websites on my screen at the same time, how do I do that on
aleksandrvk [35]
Click chrome with 2 fingers on your mousepad and click new window, you can have 2 websites open at once this way
8 0
3 years ago
Question 9<br> Any data in your Access database can be converted into labels using the
kotykmax [81]
Are there any choices
5 0
3 years ago
Write a program that teaches arithmetic to a young child. The program tests addition and subtraction. In level 1, it tests only
Elenna [48]

Answer:

Explanation:

The following program is written in Java and creates three levels with the different set of randomly generated arithmetic problems. As the player goes getting more points they advance every 5 points to the next level.

import java.util.Random;

import java.util.Scanner;

class Main {

   private static Random random = new Random();

   private static Scanner in = new Scanner(System.in);

   static int points = 0;

   public static void main(String[] args) {

       while (true) {

           System.out.println(points);

           if (points < 5) {

               System.out.println("Starting Level 1");

               levelOne();

           } else if (points < 10) {

               System.out.println("Starting Level 2");

               levelTwo();

           } else if (points < 15) {

               System.out.println("Starting Level 3");

               levelThree();

           }

       }

   }

   public static boolean levelOne() {

       int numberOne = random.nextInt(10);

       int numberTwo = random.nextInt((10 - numberOne));

       int answer = numberOne + numberTwo;

       int count = 0;

       while (points < 5 && count < 2) {

           System.out.println("What is " + numberOne + " + " + numberTwo + "?: ");

           int userChoice = in.nextInt();

           if (userChoice == answer) {

               points += 1;

               levelOne();

           } else {

               count += 1;

           }

       }

       return false;

   }

   public static boolean levelTwo() {

       int numberOne = random.nextInt(10);

       int numberTwo = random.nextInt(10);

       int answer = numberOne + numberTwo;

       int count = 0;

       while (points < 10 && count < 2) {

           System.out.println("What is " + numberOne + " + " + numberTwo + "?: ");

           int userChoice = in.nextInt();

           if (userChoice == answer) {

               points += 1;

               levelTwo();

           } else {

               count += 1;

           }

       }

       return false;

   }

   public static boolean levelThree() {

       int numberOne = random.nextInt(10);

       int numberTwo = random.nextInt(10);

       int answer = numberOne - numberTwo;

       int count = 0;

       if (answer <= 0) {

           levelThree();

       }

       while (points < 15 && count < 2) {

           System.out.println("What is " + numberOne + " - " + numberTwo + "?: ");

           int userChoice = in.nextInt();

           if (userChoice == answer) {

               points += 1;

               levelThree();

           } else {

               count += 1;

           }

       }

       return false;

   }

}

3 0
3 years ago
Other questions:
  • WILL MARK BRAINLIEST IF ANSWERED ASAP
    10·1 answer
  • what’s The abbreviation of afk and what does That Mean in gaming playing in Multiplayer online battle arena games
    10·1 answer
  • With a(n) ____ the editor, compiler, and executer are combined in the same application.
    7·1 answer
  • Cómo pongo un tomo de llamada SIN PAGAR?
    7·1 answer
  • What is the difference between the audio mixer and meters panel.
    8·1 answer
  • Computers are used to store, retrieve, and _____ data. manipulate mechanize memorize operate
    12·1 answer
  • what are the Technologies in regarding of communication technology? Please help me I'll rate you as brainliest!​
    13·1 answer
  • Which of the following is defined in terms of their activities related to denial-of-service attacks? Cracker Script kiddie White
    6·1 answer
  • How are gems and precious metals similar?
    6·2 answers
  • Create a program to determine the largest and smallest number out of 15 numbers entered (numbers entered one at a time). This sh
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!