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
Question 6 (1 point) Authoritarian governments tend to ignore rules limiting their power, if there are any rules Question 6 opti
Elina [12.6K]

Answer:

True.

Explanation:

An authoritarian government is also known as dictatorship and it can be defined as a type of government in which an individual who is a sole administrator is responsible for controlling, managing and directing the affairs of the particular country. Therefore, they do not listen to anyone else but rather are saddled with the decision-making responsibilities without consulting any other government official.

Hence, authoritarian governments tend to ignore rules limiting their power, if there are any rules.

Some examples of authoritarian governments was that of idi amin of Uganda.

4 0
3 years ago
Communication that is appropriate, effective, and ethical is considered a. interactive. b. competent. c. mediated. d. public.
oee [108]

Answer: B. competent

Explanation: When you communicate in such a way that you put your self in the shoes of the receiver of the information, you don't take advantage of the situation he or she is in while also being appropriate and ethical by showing some moral respect; then you are a competent communicator.

5 0
4 years ago
During this attack, about US troops were killed.
erma4kov [3.2K]

Answer:

what's the question? I do not get it?

Explanation:

?

7 0
3 years ago
Which two words compose the spondee?who loved his charge but never loved to lead;one whose meek flock the people loved to be,not
Elan Coil [88]
The spondee characteristically does not deliver the foundation for a metrical line in poetry. As an alternative, spondees are create as irregular feet in meter based on alternative type of foot. The answer for this question is meek flock since these are two stressed syllables together.
3 0
3 years ago
In which way is the freedom of speech and Civil Rights Act of 1964 (which made segregation illegal) similar? both establish just
Vika [28.1K]

The answer is <u>both secure the freedoms of liberty </u>

<u> </u>



6 0
3 years ago
Read 2 more answers
Other questions:
  • There are 100 u.s. senators. How many senators would constitute a majority?
    9·1 answer
  • 4. How many justices are there on the current Supreme Court?
    11·2 answers
  • Write about situations in which you think compromise is appropriate and situations in which you thing compromise is not appropri
    10·1 answer
  • "When the legislative and executive powers are united in the same person, or in the same body of magistrates, there can be no li
    13·2 answers
  • What did Parliament do to address the huge debt created by the French and Indian War?
    13·1 answer
  • In what way were the Ku Klux Klan and the Freedmen's Bureau the same?
    5·1 answer
  • What steps does the government always take in order to create public policy? Check all that apply.
    12·1 answer
  • What are the informal means of socialization​
    9·1 answer
  • How did the roman republic come to an end bullet points please
    14·1 answer
  • Which division of biopsychology is most likely to be identified with the assessment of the memory deficits of patients with dama
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!