1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Yakvenalex [24]
3 years ago
5

A program that accepts data for an ID number of a dog's owner, and the name, breed, age, and weight of the dog. Display a bill c

ontaining all the input data as well as the weekly day care fee, which is $55 for dogs weighing less than 15 pounds, $75 for dogs from 15 to 30 pounds inclusive, $105 for dogs from 31 to 80 pounds inclusive, and $125 for dogs weighing more than 80 pounds.
Social Studies
1 answer:
hram777 [196]3 years ago
6 0

Answer:

JAVA program is as follows.

import java.util.Scanner;  

import java.util.*;

public class Program{  

public static void main(String args[]){

   Scanner sc = new Scanner(System.in);

   int id;

   String name, breed;

   int age;

   double weight;

   int weekly_day_care_fee_15 =55;

   int weekly_day_care_fee_30 =75;

   int weekly_day_care_fee_80 = 105;

   int weekly_day_care_fee_greater =125;

   int weekly_day_care_fee=0;

   System.out.print("Enter id of dog's owner: ");

   id = sc.nextInt();

   System.out.print("Enter name of the dog: ");

   name = sc.next();

   System.out.print("Enter breed of the dog: ");

   breed = sc.nextLine();

   System.out.print("Enter age of the dog: ");

   age = sc.nextInt();

   System.out.print("Enter weight of the dog: ");

   weight = sc.nextDouble();

   if(weight<15)

       weekly_day_care_fee = weekly_day_care_fee_15;

   if(weight>=15 && weight<30)

       weekly_day_care_fee = weekly_day_care_fee_30;

   if(weight>=30 && weight<80)

       weekly_day_care_fee = weekly_day_care_fee_80;

   if(weight>=80)

       weekly_day_care_fee = weekly_day_care_fee_greater;

   System.out.println("");

   System.out.println("====== BILL FOR WEEKLY DAY CARE OF DOGS ======");

   System.out.println("");

   System.out.println("ID of dog's owner \t \t \t \t \t: "+id);

   System.out.println("Enter name of the dog \t \t \t \t: "+name);

   System.out.println("Enter breed of the dog \t \t \t \t: "+breed);

   System.out.println("Enter age of the dog \t \t \t \t: "+age);

   System.out.println("Enter weight of the dog \t \t \t: "+weight);

   System.out.println("The weekly day care fee of the dog  : $"+weekly_day_care_fee);

}  

}

OUTPUT

Enter id of dog's owner: 123

Enter name of the dog: JOHN

Enter breed of the dog: BULLDOG

Enter age of the dog: 3

Enter weight of the dog: 70

====== BILL FOR WEEKLY DAY CARE OF DOGS ======

ID of dog's owner                       : 123

Enter name of the dog                    : JOHN

Enter breed of the dog        : THERAPY

Enter age of the dog        : 3

Enter weight of the dog      : 70.0

The weekly day care fee of the dog    : $105

Explanation:

1. All the variables are declared inside main() hence, not declared as static.

2. Variables are declared to hold owner id, name and breed of the dog, age and weight of the dog.

3. Variables are declared and initialized for all values of day care fees.

4. Multiple if statements are used to determine the fees based on the weight.

You might be interested in
Can someone help me to draw a use case and class diagram please
Vinil7 [7]

Answer:

draw four line on each side connecting to the text  and draw two below the same way

Explanation:

3 0
3 years ago
Based on information in the Article, which of the following best describes the difference between
ella [17]

Answer:

D

Explanation:

7 0
3 years ago
Stage 6 started the slow and painful recapturing of the capital seoul, which then turned into a stalemate. gen. ridgway and his
mart [117]
The meat grinder in the Korean war was actually a strategy that they used. There were stills combats that were being deployed to the war to fight. And most of the attacks are initiated by one or single combat unit. The attack strength is on the lower left while the defense is on the lower right.
3 0
3 years ago
Read 2 more answers
Why is it important to maintain clear evacuation routes at all times?
Elden [556K]
It's important to keep a clear evacuation route is because you need to make sure that you and your family, friends, etc, can get out safe, and alive. 
6 0
3 years ago
Socrates would argue against himself to poke holes in his own line of reasoning. Why did he think this was important
larisa [96]

Answer:

Sometimes we convince ourselves that we are right and Socrates being an extremely intelligent person might simply come up with an idea and share it to the world and his fellow thinkers, but instead he thought twice and tried to disprove his own idea to see if it really was correct, original and going to be accepted.

3 0
3 years ago
Other questions:
  • A thorough testing of the possible explanations for a problem is called an evaluation study.
    10·1 answer
  • In the following citation from EDSeek (also known as Expanded Academic ASAP), what is the publication title? The way we lie now:
    10·2 answers
  • Older adults who __________ adapt more favorably and feel better about it.
    15·1 answer
  • A psychologist is teaching a woman with intellectual disabilities the skills that she needs to clean her apartment. Training ses
    10·1 answer
  • The Constitution allows each branch of the government checks on the power of the other two branches. Which check does the execut
    14·1 answer
  • What two groups of people that were affected by the constitutional convention ​
    14·1 answer
  • Meg is a perfectionist. She is so preoccupied with perfection she almost never gets things done on time. She procrastinates and
    10·1 answer
  • Home az-grade 8 citizenship and civic engagement a-cr unit test quizlet
    6·1 answer
  • PLEASE HELP ME<br> DONT JUST USE ME FOR MY POINTS
    7·1 answer
  • What is development? Write any four points to show the importance of development​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!