Write a java programm that calculates the total of a retail sale should ask the user for the following: The retail price of the item being purchased The sales tax rate Once these items have been entered, the program should calculate and display the following: The sales tax for the purchase The total of the sale I tried doing it here. but it is not giving me the right answer. kindly help correct the errors.
import java.util.Scanner; public class SalesTax { public static void main(String[] args)
{ //identifier declarations int TAX_RATE = 825;//8.25%
int price; String item;
//create a Scanner object to read from the keyboard Scanner keyboard = new Scanner(System.in);
//prompt and get input System.out.print("Item description: ");
item = keyboard.nextLine();
System.out.print("Item price: $"); price = keyboard.nextprice();
//calculations tax = price + (TAX_RATE/100);
total = price + tax; //display results System.out.print(item + " $");
System.out.println(price);
System.out.print("Tax $");
System.out.println(tax);
System.out.print("Total $");
System.out.println(total);
}
}
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
Write a java programm that calculates the total of a retail sale should ask the user...
Java debugging in eclipse
package edu.ilstu;
import java.util.Scanner;
/**
* The following class has four independent debugging
* problems. Solve one at a time, uncommenting the next
* one only after the previous problem is working correctly.
*/
public class FindTheErrors {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
/*
* Problem 1 Debugging
*
* This problem is to read in your first name,
* last name, and current year and display them in
*...
Using Java please help me return the total to getTicketData() so it will display in my displayTicketData() function. Everything in my display function is a sent to a display class that works well for strings already. import java.util.Scanner; public class ticketing { //Declaring variables for strings and integers private int ticketNum; //Using the Scanner to scan in data input by user Scanner s = new Scanner(System.in); void getTicketData() { //Methods...
Need help with the UML for this code? Thank you. import java.util.Scanner; public class Assignment1Duong1895 { public static void header() { System.out.println("\tWelcome to St. Joseph's College"); } public static void main(String[] args) { Scanner input = new Scanner(System.in); int d; header(); System.out.println("Enter number of items to process"); d = input.nextInt(); ...
// please i cant understand why this program isnot running HELP me please? import java.util.Scanner; public class String { public static void main(String[] args) { double Sside, Rlength, Rwidth, Tbase, Theight, Area, Tarea, Rarea; String input; Scanner keyboard = new Scanner(System.in); System.out.print("To Calculate the are of Square Enter 'Square', For Rectangle Enter 'Rectangle', For Triangle Enter 'Triangle'"); input = keyboard.nextLine(); if (input.equalsIgnoreCase("SQUARE")) { System.out.println("Square Side"); Sside = keyboard.nextInt(); Tarea = Sside * Sside; System.out.println("Side = " + Tarea ); }...
import java.util.Scanner; // TASK #1 Add the file I/O import statement here /** This class reads numbers from a file, calculates the mean and standard deviation, and writes the results to a file. */ public class StatsDemo { // TASK #1 Add the throws clause public static void main(String[] args) { double sum = 0; // The sum of the numbers int count = 0; // The number of numbers added double mean = 0; // The average of the...
For this program I ran it and it said illegal start of the expression for line 49 where I have public static double how do I fix it? A bakery sells three types of muffins whose prices are as follows: 1- blueberry muffin, $2.98 2- chocolate chip muffin, $4.50 and 3- banana muffin, $9.98. You will write an application which calculates the total retail value of the sold muffins. Please check the following requirements: • Create a sentinel-controlled while loop....
Online shopping cart (continued) (Java) Hello, I need help with Java to figure this out. In my Shopping Cart Manager Class (Bottom Code), I get "Resource leak: 'sc' is never closed." I have tried multiple things and cannot figure it out. Thank you. Online shopping cart (continued) (Java) Hello, I need help with Java to figure this out. In my Shopping Cart Manager Class (Bottom Code), I get "Resource leak: 'sc' is never closed." I have tried multiple things and...
You will write a single java program called MadLibs. java. This file will hold and allow access to the values needed to handle the details for a "MadLibs" game. This class will not contain a maino method. It will not ask the user for any input, nor will it display (via System.out.print/In()) information to the user. The job of this class is to manage information, not to interact with the user.I am providing a MadLibsDriver.java e^{*} program that you can...
Below, you can find the description of your labwork for today. You can also find the expected output of this code in the Application Walkthrough section. You are going to improve your existing Money & Stock Trading Platform on previous week’s labwork by incorporating Collections. In previous labworks, you have used arrays for holding Customer and Item objects. For this labwork you need to use ArrayList for holding these objects. So, rather than defining Customer[] array, you need to define...
In Java chapter 7 Arrays. Ask the user for five names. Output those names. Put an integer before each name to indicate the ordering Here are the required output Test Case 1 Standard Input BillENTER SteveENTER MarkENTER ElonENTER Henry Enter five names\n Enter friend 1\n Enter friend 2\n Enter friend 3\n Enter friend 4\n Enter friend 5\n Here are all of those names\n Friend 1 is Bill\n Friend 2 is Steve\n Friend 3 is Mark\n Friend 4 is Elon\n...