Computers and Technology, 21.07.2021 14:00 michelle7511
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;
}
}
Answers: 1
Computers and Technology, 22.06.2019 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
Computers and Technology, 23.06.2019 14:30
Select the correct answer. andy received a potentially infected email that was advertising products. andy is at risk of which type of security threat? a. spoofing b. sniffing c. spamming d. phishing e. typo-squatting
Answers: 2
Hi ! How can you return the value of the class computeDiscountInfo to the variable savings in the ma...
Mathematics, 27.05.2021 22:20
History, 27.05.2021 22:20
Chemistry, 27.05.2021 22:20
Social Studies, 27.05.2021 22:20
Mathematics, 27.05.2021 22:20
Physics, 27.05.2021 22:20
Mathematics, 27.05.2021 22:20
Mathematics, 27.05.2021 22:20
Biology, 27.05.2021 22:20