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
Which process is a feature of webmail?
GalinKa [24]
Your mail gets sent across the internet to the other person you mailed to.
7 0
3 years ago
You have repaired a broken lcd panel in a notebook computer. however, when you disassembled the notebook, you bent the hinge on
Shtirlitz [24]

First things first, you'll have to explain what happened, Secondly you must give the customer the option to choose whether he/she would prefer to temporarily take the laptop and schedule another time to have the hinge be repaired as you can provide the reason that you have prioritize to fix the functional aspect of the laptop rather than the cosmetic issues of the laptop. Putting yourself in the shoes of the customer whilst picking your statement would help to alleviate the concern or complain from the customer.

4 0
4 years ago
What is a device that makes it possible for multiple customers to share one address is called a/n
chubhunter [2.5K]
I'm totally not sure but I think sec midterm flashcards
4 0
4 years ago
If you are working in a word-processing program and need to learn about its features, the best place to get assistants is from t
Hoochie [10]

Answer:

A

Explanation:

plz mark me brainlies

7 0
3 years ago
Read 2 more answers
The _________ attack exploits the common use of a modular exponentiation algorithm in RSA encryption and decryption, but can be
lions [1.4K]

Answer:

chosen ciphertext

Explanation:

Chosen ciphertext attack is a scenario in which the attacker has the ability to choose ciphertexts C i and to view their corresponding decryptions – plaintexts P i . It is essentially the same scenario as a chosen plaintext attack but applied to a decryption function, instead of the encryption function.

5 0
3 years ago
Other questions:
  • While traveling in India, Sabina notes all of her daily expenses in rupees in her spreadsheet. At the end of the day, she wants
    8·1 answer
  • ____________ is/are the information, knowledge of people or things, and connections that help individuals enter preexisting netw
    13·1 answer
  • If you delete selected cells using the Delete key on your keyboard, only the _______ of the cells is removed. formatting content
    8·2 answers
  • Which one of the following may be used as an input as well as an output device? A. Fax machine B. Scanner C. Printer D. Voice re
    9·1 answer
  • Assume the list numbers1 has 100 elements, and numbers2 is an empty list. Write code that copies the values in numbers1 to numbe
    15·1 answer
  • What will the following segment of code output? Assume the user enters a grade of 90 from the keyboard. cout << "Enter a t
    5·1 answer
  • What features are offered by most of the email programs with for receiving and sending messages?
    10·1 answer
  • Which activity might require you to provide your social security number
    8·2 answers
  • USB 3.1 offers an improvement over its predecessors by enabling a maximum data transfer rate of up to:
    8·1 answer
  • Match the following internet related terms to their definition
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!