Computers and Technology

Hi ! How can you return the value of the class computeDiscountInfo to the variable savings in the main class ? Here is my code :

import java. util. Scanner;
public class RoomCost{
public static void main (String [] args){
double price;
double discount;
double savings;

Scanner keyboard = new Scanner(System. in);
System. out. print("Enter cutoff price for discount $>> ");
price = keyboard. nextDouble();
System. out. print("Enter discount rate as a whole number >> ");
discount = keyboard. nextDouble();
displayinfo();
//insert code to set the value returned from computeDiscountInfo method to savings);
// savings =
System. out. println("Special this week on any room over " + price);

System. out. println("Discount of " + discount + " percent");

System. out. println("That's a savings of at least $" + savings);
}
public static void displayinfo(){
System. out. println("We want your stay to be memorable.");

System. out. println("We promise to make you as comfortable as possible.");

}
public static double computeDiscountInfo(double price, double discountRate)

{

double savings;

//(insert code to calculate savings as price multiplied by discount divided by 100);
savings = (price * discountRate)/100;
return savings;
}

}


Hi ! How can you return the value of the class computeDiscountInfo to the variable savings in the m

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 23.06.2019 05:00, mikeysoulemison
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, camiserjai1832
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
image
Computers and Technology, 23.06.2019 18:50, ana7496
What is transmission control protocol/internet protocol (tcp/ip)? software that prevents direct communication between a sending and receiving computer and is used to monitor packets for security reasons a standard that specifies the format of data as well as the rules to be followed during transmission a simple network protocol that allows the transfer of files between two computers on the internet a standard internet protocol that provides the technical foundation for the public internet as well as for large numbers of private networks
Answers: 2
Do you know the correct answer?
Hi ! How can you return the value of the class computeDiscountInfo to the variable savings in the ma...

Questions in other subjects: