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
Greeley [361]
3 years ago
11

Write a program that asks the user for the name of their dog, and then generates a fake DNA background report on the pet dog. It

should assign a random percentage to 5 dog breeds (that should add up to 100%!)
Computers and Technology
1 answer:
sukhopar [10]3 years ago
6 0

Answer:

Code:

import java.util.*;

public class Main{

public static void main(String []args){

 

Scanner sc = new Scanner(System.in);

System.out.println("What is your dog's name?");

// Entering name of dog

String name = sc.nextLine();

 

System.out.println("Well then, I have this highly reliable report on " + name + "'s prestigious background right here.");

 

System.out.println("\n\nSir " + name + " is\n\n");

 

//Generating random numbers

Random ran = new Random();

int sum = 0;

int a = 0;

int b = 0;

int c = 0;

int d = 0;

int e = 0;

while(sum != 100)

{

a = ran.nextInt(100);

b = ran.nextInt(100-a);

c = ran.nextInt(100-b);  

d = ran.nextInt(100-c);

e = ran.nextInt(100-d);

sum = a + b+ c + d + e;

}

 

System.out.println(a + "% St. Bernard");

System.out.println(b + "% Chihuahua");

System.out.println(c + "% Dramatic RedNosed Asian Pug");

System.out.println(d + "% Common Cur");

System.out.println(e + "% King Doberman");

 

System.out.println("\n\nWow, that's QUITE the dog!");

 

}

}

You might be interested in
Int a=10 int b=20<br> A=b<br> The new values for a and b are
loris [4]
After a = b new values would be: a = 20, b = 20
3 0
3 years ago
Read 2 more answers
Polynomial regression A common misconception is that linear regression can only be used to fit a linear relationship. We can fit
3241004551 [841]

Answer:

robuk plss55 5=5

Explanation:

just 5 pawpatrol

8 0
2 years ago
I NEED HELP!! THIS IS 3D COMPUTER MODELING COURSE IN CONNEXUS
Papessa [141]

6. x, y, and z (x is right, z is forward, and y is up)

7. true

8. plane

9. Cartesian grid

10. They describe a location using the angle and distance from the original.

11. effects that alter the look of an object.

12. true

13. true

14. (not sure, but I would go with conceptual)

15. 3-D elements

Hope this helps! Please let me know if you need more help, or if you think my answer is incorrect. Brainliest would be MUCH appreciated. Have a great day!

Stay Brainy!

8 0
2 years ago
Upang mas maging maganda ang larawang ini-edit, dapat isaalang-alang ang tatlong mahahalagang elemento. Ano-ano ang mga ito?​
Gemiola [76]

Answer:

is this english?

Explanation:

4 0
3 years ago
Write a program to Test if mold is stored in the variable word.
Aloiza [94]

word = whatever value you want.

if "mold" in word:

   print("Mold is in the variable word.")

else:

   print("Mold is not in the variable word.")

7 0
3 years ago
Other questions:
  • #Imagine you're writing a program to check if a person is
    8·1 answer
  • Which is NOT a way the network operating sys-
    6·1 answer
  • Which PowerShell command will upgrade the VM configuration version to take advantage of the new features in Windows Server 2016?
    12·1 answer
  • Which remote assistance option requires peer name resolution protocol (pnr) and ipv6?
    5·1 answer
  • What is the difference between primary storage, secondary storage and off-line storage?
    5·1 answer
  • Weak Induction
    8·1 answer
  • ___________ is related to mass, but also includes the gravitational pull of the Earth.
    14·1 answer
  • javascript Write a program to calculate the credit card balance after one year if a person only pays the minimum monthly payment
    7·1 answer
  • Ray is recording his voice for a presentation and can adjust the bit depth. Increasing the bit depth will mean that sound is sam
    12·1 answer
  • Places where computer are used​
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!