Answer is required in java
code:using scanner
import java.util.Scanner;
public class bill {
public static void main(String[] args) {
double x, y, Subtotals,Tax,Total;
Scanner myObj = new Scanner(System.in); // Create a Scanner object
System.out.println("Enter the quantity:");
x = myObj.nextInt(); // Read user input
System.out.println("Enter the unit price :");
y = myObj.nextInt(); // Read user input
Subtotals = x * y;
Tax =(Subtotals*6)/100;
Total=Subtotals+Tax;
System.out.println("---------[Print Receipt]---------" );
System.out.println("-Enter the quantity: + x);
System.out.println("-Enter the unit price : $ " + y);
System.out.println("-Subtotals : $ " + Subtotals);
System.out.println("-Tax $ : " + Tax);
System.out.println("-Total $ : " + Total);
System.out.println("---------------------------------" );
}
}
Write program calculate the final price of a purchased item using values entered by the user Hint: you are required to use formatting output for number, currency and percentage.
Q1. Write program calculate the final price of a purchased item using values entered by the user Hint: you are required to use formatting output for number, currency and percentage. --------------------[Print Receipt] ------------ Enter the quantity: 6 Enter the unit price: $1.98 Subtotals: $10.14 Tax: $ 0.61 at 6% Total: $10.75 ------------------------------------------------ Q2. Write a program that prompts for and reads the users’ first name and last name, Job title, DOB (date of Birth), and the Email address (separately). Then...
Write a Java program that: • Asks the user to enter the number of integers that he need to enter; • Asked him to enter integer by integer; • Print The number of Odd numbers entered and the number of Even numbers entered. Important notes: 1. You should have to copy and paste the Java as your answer for this question. DON’T take screen shot for your Java Code. It must be editable. 2. Take a screen shot for your...
Please write a java program that takes a large, user-entered number (usually 10 digits) and tallies the 10 digits to be used in an array. Then, the method should tell the user how many of each number was input. For example, for the number 445903218, the program should say "2 4's, 1 5...," etc etc.
Write a Java program that prompts user to calculate area of five different shapes using java library, and at least 2 classes - more of OOP, also use divide and conquer methods.
You are to write a program (BookExceptionsDemo.java) that will
create and, using user input, populate an array of instances of the
class Book. The class Book is loaded in our Canvas files:
Book.java
The user will enter a number n (n must be > 0, trap the user
until they input a valid value for n), Your program will declare
and create an array of size n of instances of the class Book.
The user will be asked to enter...
For this assignment, you will write a program that guesses a number chosen by your user. Your program will prompt the user to pick a number from 1 to 10. The program asks the user yes or no questions, and the guesses the user’s number. When the program starts up, it outputs a prompt asking the user to guess a number from 1 to 10. It then proceeds to ask a series of questions requiring a yes or no answer....
Answer using C++ Write a program that will calculate the final sales price of a motorcycle; this includes additional optional packages along with sales tax. You may assume that the base? price of the motorcycle is $30,000. First you must ask the user to choose which optional packages they want. The user is only permitted to choose one package. Your program should display a menu of the available packages. The user should enter the package by entering the letter associated...
Write a program that asks the user to give you a number, then use that number to read a number of strings equal to that number, and finally compute the total length
Write a SIMPLE JAVA program to store a positive number a user inputs until he enters 0. Print all the numbers entered at the end. The dialog might look like: Enter Number: 1 Enter Number: 10 Enter Number: 0 You entered numbers 1, 10
Use Java language to write this program Programming Exercise 3.20 required you to design a PID manager that allocated a unique process identifier to each process. Exercise 4.20 required you to modify your solution to Exercise 3.20 by writing a program that created a number of threads that requested and released process identifiers. Now modify your solution to Exercise 4.20 by ensuring that the data structure used to represent the availability of process identifiers is safe from race conditions. Use...