Answer to Question #205934 in Java | JSP | JSF for itumeleng

Question #205934

The Bone Jour Dog Day Care Centre charges clients a daily rate that is based on both the size of the dog and number of days per month in a client’s contract. The following tableshows the daily rates.Prompt the user to enter a dog’s weight and number of days per month needing care, then calculate and display the daily rate and the total for the month (days times the daily rate). Save the file as DogDayCare.java


1
Expert's answer
2021-06-11T12:33:18-0400
import java.util.Scanner;


public class DogDayCare {


	public static void main(String[] args) {
		int dogsWeight = 0;
		int days = 0;
		double dailyRateCount = 0;
		double dailyRate = 1.5;
		Scanner input = new Scanner(System.in);
		System.out.println("Please provide your dogs weight (in pounds) and press Enter: ");
		dogsWeight = input.nextInt();
		dailyRateCount = dogsWeight * 1.5;
		System.out.println("Thank you.For dog with weight: " + dogsWeight + " pounds, daily rate is: " + dailyRate
				+ " one day care cost: $" + dailyRateCount);
		System.out.println("Please provide days for your dogs staing on care and press Enter: ");
		days = input.nextInt();
		dailyRateCount = dailyRateCount * days;
		System.out.println("Thank you.For dog with weight: " + dogsWeight + " daily rate is: " + dailyRate + " and"
				+ days + " day care cost: $" + dailyRateCount);
		input.close();


	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS