
Concept explainers
A well-monitored transaction solution for Joe's Pizza, your friendly neighborhood pizza shop.
Joe decides that he wants to have some personal time as soon as he can make enough income. So in addition to regular transaction recording, he also wants to computer to monitor the running total on the fly. If the total sales is greater than $100, the computer program should give him the sum of sales, tell him he can go home, and exit. Modify the previous transaction record program to make this happen.
these are the codes form before
can you plz write it in java.util.scanner form
and can you make it so i can copy and past it thank you in advance
the codes form before
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package change;
import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author Mabda
*/
public class Change {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner key = new Scanner(System.in);
int myArray[] = new int [7];
int sum = 0;
for(int i = 0; i < 7; i++) {
System.out.print("Enter income of day "+(i+1)+" :");
myArray[i] = key.nextInt();
sum = sum + myArray[i];
}
System.out.println("Total income of week is :"+sum);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg1;
import java.util.Scanner;
/**
*
* @author Mabda
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
int num,sum = 0;
char choice;
Scanner key = new Scanner(System.in);
while(true)
{
System.out.print("\nEnter sale amount: ");
num = key.nextInt();
sum+=num;
System.out.print("Do you want to continue..: ");
choice = key.next().charAt(0);
if(choice == 'n')
{
System.out.print("\nToday's sum of all sales: "+ sum+"\n\n");
break;
}
}
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkg2;
import java.util.Arrays;
import java.util.Scanner;
/**
*
* @author Mabda
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner key = new Scanner(System.in);
int myArray[] = new int [7];
int sum = 0;
for(int i=0; i<7; i++){
System.out.print("Enter income of day "+(i+1)+" :");
myArray[i] = key.nextInt();
sum = sum + myArray[i];
}
System.out.println("Total income of week is :"+sum);
}
}

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

- 3) Suppose an airline company has hired you to write a program for choosing the passengers who should leave an overbooked flight. That means the airline has booked too many passengers hoping some of them would not show up on time, but passengers are on board and the aircraft doesn't have enough seats available for all these passengers. Your program chooses the passenger who must leave the flight. Passengers will be ranked based on the fare they have paid for booking (a double number called fare), and their number of loyalty points (an integer number called points). Fare and points are equally important, that means, in order to decide the position of each passenger in the list, fare and points each have 50% importance. A Person with minimum priority (combination of fare and points) will leave the flight. You need to define a class called Passenger with these member variables: passenger's name • fare points. Passenger class must have 3 accessors, 3 mutators, a constructor with three…arrow_forwardIn java, create a program that will use a do while loop with a "yes/no" prompt. The program should include user input and output with getters and setters. Once the end of the loop is reached, ask the user if they'd like to do the program again. Answering "Yes" will start the program over again. Answering "No" will end the program. Answering with anything else will be an invalid input. Once the loop begins again, the program should also discard all previous inputs so that there won't be any overlapping. Use Scanner.nextLine();, it will help.arrow_forwardA controlled transaction solution for Joe's Pizza, your friendly neighborhood pizza shop.Joe only make $200 worth of pizza everyday. Modify your program so that if the running total will exceed $200, print a warning and DO NOT add this value to running total. Instead, go to the beginning of loop statement block and wait for next transaction. can you please write it in import java.util.Scanner; and can you make it so i can copy and past it. thank you in advance the code from before /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package personal;import java.util.Scanner;/** * * @author Mabda */public class Personal { /** * @param args the command line arguments */ public static void main(String[] args) { int num, sum = 0; char choice; Scanner key = new Scanner(System.in); while (true) {…arrow_forward
- don't want the step i want the answers. Also this is not quiz but homeworkarrow_forwardA company wants to know the percentages of total sales and total expenses attributableto each salesperson. Each person has the following data: name – last name and firstname, sales, and expenses. Write a program that produces a report with a header linecontaining the total sales and total expenses. Following this heading should be a tablewith each salesperson’s name, percentage of total sales, and percentage of totalexpenses sorted by the salesperson’s name. Use a total of 25 records for this project.arrow_forwardA place to buy candy is from a candy machine. A new candy machine is bought for the gym, but it is not working properly. The candy machine has four dispensers to hold and release items sold by the candy machine and a cash register. The machine sells four products — candies, chips, gum, and cookies—each of which is stored in a separate dispenser. You have been asked to write a program for this candy machine so that it can be put into operation. The program should do the following: Show the customer the different products sold by the candy machine Let the customer make the selection Show the customer the cost of the item selected Accept money from the customer Return change Release the item, that is, make the sale Note: java programming, please used given outline code //Implement the blueprint of the Candy Machine import java.util.*; public class CandyMachine { // Each candy machine is made of 1 CashRegister and 4 Dispensers CashRegistercashRegister; Dispensercandy;…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





