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
In pseudocode you can use the _________ library function to determine whether a character is an alphabetic letter.
Sunny_sXe [5.5K]

Answer:  isalpha()

Explanation:

isalpha() is the library function that is used for algorithm and programs for checking whether the given character is alphabet or any other character such as numbers,etc.It can take a integer value for checking character and then return a integer value.

  • The passed character for checking gets converted into integer form for evaluation.If the returned integer is zero then ,given character is not alphabet otherwise a non- zero return value indicated alphabet.
  • isalpha() Function Prototype :-int isalpha(int argument);

6 0
3 years ago
In what country did true printing first take place?
kow [346]
Germany. Johannes Guten in Mainz, Germany
7 0
3 years ago
Read 2 more answers
What is a good analogy for explaining the actions of a compiler?
kozerog [31]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

This question is about what is a good analogy for explaining the actions of a compiler?  The correct option is <u> automatic programming of kitchen devices .</u>

<u> </u>

a hybrid ability of a car to use multiple energy sources  (false)

this analogy is not correctly mapped on the compiler, becuase the compiler can be designed only for one type of language, for example, the program that calculates the average of students number can be easily programmed in C++ and in C#. But you cannot compile the C# program in C++ compiler and vice versa.  

a street map of a local subdivision  (false)

Because you can design a compiler for a not specific subdivision of programming.

an interpreter who speaks several languages

it is not an analogy, however, an interpreter can handle only one type of language.

an automatic programming of kitchen devices (true)

This is a good analogy of compiler because you give input to the device and that device based on your input gives you back an output. Similarly, you give input to the compiler in form of language syntax, and it automatically give you output based on your input.

3 0
4 years ago
Time management is all about managing your emotions. <br> True <br> False
Alex777 [14]
I’m pretty sure it’s true
5 0
3 years ago
Read 2 more answers
A game design company develops a game in which players run a grocery store and need to keep tabs on the dollar amount of goods s
wolverine [178]
Is it multiple choice? if not then probably a multi-tasking or strategy though i'm just guessing sorry.
4 0
3 years ago
Other questions:
  • A video conferencing application isn't working due to a Domain Name System (DNS) port error. Which record requires modification
    15·1 answer
  • Excel 2016 is primarily what type of program?
    15·1 answer
  • In a doubly linked list, every nodecontains the address of the next node and the previousnode except for the ____ node.
    8·1 answer
  • What is the rationale behind the development of an operating system in computing?
    15·1 answer
  • When there is a limited amount of a product, such as rare art or collectible
    13·1 answer
  • Making an analogy between Freudian theory and the brain networks described in an earlier chapter in the text, primary process th
    10·1 answer
  • Regarding computer protection, quarantining is defined as ________.
    9·1 answer
  • Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a
    14·1 answer
  • In what ways can you modify the location of the neutral point?
    12·1 answer
  • Design a program that will ask the user to enter the amount of a purchase. The program
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!