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
Airida [17]
3 years ago
6

The following code does not work as intended. It is meant to input two test grades and return the average in decimal format: int

test1 = scan.nextInt(); int test2 = scan.nextInt(); double average = (test1 + test2 )/2; System.out.println("Answer: " + average);
Computers and Technology
1 answer:
yuradex [85]3 years ago
6 0

Answer:

To return average in Decimal we will use float datatype instead of double.

Explanation:

int test1 = scan.nextInt();

int test2 = scan.nextInt();

float average = (test1 + test2 )/2;

System.out.println("Answer: " + average);

You might be interested in
The basic components of cartridges and shotshells are similar. Shot pellets and a bullet are examples of which basic component?
Liono4ka [1.6K]
The answer is projectile. Handguns and rifles use a cartridge having a single projectile or bullet. Shotguns use a shot shell comprising either a single bullet or a big number of small projectiles (shot or pellets). Though, the basic components of cartridges and shot shells are alike.
5 0
3 years ago
Which of the following is/are used in multimedia?
SCORPION-xisa [38]

Answer:

<em> </em><em>I </em><em>think</em><em> </em><em>text </em><em>and </em><em>pictures</em><em> </em><em>because</em><em> </em><em>I </em><em>know </em><em>it </em><em>is </em><em>in </em><em>my </em><em>book </em><em>I </em><em>hope</em><em> it</em><em> will</em><em> help</em><em> you</em><em> have</em><em> a</em><em> great</em><em> day</em><em> bye</em><em> and</em><em> Mark</em><em> brainlist</em><em> if</em><em> the</em><em> answer</em><em> is</em><em> correct</em><em> </em>

<em>kai6417</em>

<em>#</em><em>c</em><em>a</em><em>r</em><em>r</em><em>y</em><em> </em><em>on </em><em>learning</em>

5 0
2 years ago
As it turns out, the scale of this chart is higher than all of these; it’s “exponential.” What does this imply for the difficult
Oksanka [162]

Answer:

no meme

Explanation:

[...]

8 0
3 years ago
Suppose that the format for license plates in a certain state is two letters followed by four numbers. (a) How many different pl
Ymorist [56]

Answer:

(a) 6,760,000 plates

(b) 3,407,040 plates

(c) 6,084,000 plates

Explanation:

The very first thing to note about this question is the number of characters involved in the license plate format (6 characters in this case; 2 letters and 4 numbers). The letters come first and then the numbers follow.

There are a total of 26 possible letters (A-Z) and 10 possible numbers (0 - 9) that can be chosen. We can then proceed to the first question;

(a) Here, the total number of possible plates is to be determined. This is done as follows:

Character 1 (Letter): There are 26 possible letters

Character 2 (Letter): There are 26 possible letters

Character 3 (number): There are 10 possible numbers

Character 4 (number): There are 10 possible numbers

Character 5 (number): There are 10 possible numbers

Character 6 (number): There are 10 possible numbers

So, total number of different plates will be obtained by multiplying all the possibilities: 26 × 26 × 10 × 10 × 10 × 10 = 6,760,000 plates

(b) This second part puts a constraint on the usage of the numbers, unlike the question (a), where there was no constraint at all.

Since there is no constraint on the letters, we can write that:

Character 1 (Letter): There are 26 possible letters

Character 2 (Letter): There are 26 possible letters

For the first number as well, we can write:

Character 3 (number): There are 10 possible numbers

However, for the remaining characters, the possibilities will continually reduce by a value of 1, since we can not use a number that has been used before. So,

Character 4 (number): There are 9 possible numbers

Character 5 (number): There are 8 possible numbers

Character 6 (number): There are 7 possible numbers

So, total number of different plates will be: 26 × 26 × 10 × 9 × 8 × 7 = 3,407,040 plates

(c) Here, repetitions are allowed as in questions (a), but there can not be four zeros. This implies that the maximum number of zeros in any plate will be three. Thus, there will be maximum possibilities on all characters until the last one which will be constrained.

Character 1 (Letter): There are 26 possible letters

Character 2 (Letter): There are 26 possible letters

Character 3 (number): There are 10 possible numbers

Character 4 (number): There are 10 possible numbers

Character 5 (number): There are 10 possible numbers

Character 6 (number): There are 9 possible numbers

Total number of plates will therefore be: 26 × 26 × 10 × 10 × 10 × 9 = 6,084,000 plates.

7 0
3 years ago
Write a program which will -
Hitman42 [59]

Answer:

down below

Explanation:

score = input() # gets student's score input

max = input() # gets max number

percent = (score/max)*100 # multiply by a hundred to get percentage

if percent > 52: # checks if percent is greater than 52

  print("well dont you have at least a grade 5")

else # if percent is less than or equal to 52 it will print this instead

  print("Unlucky, you need to revise more for the next test.")

THIS PART IS NOT CODE:

make sure you indent/tab the print statements or else you'll get an error

6 0
2 years ago
Other questions:
  • How should a cover letter begin?
    13·2 answers
  • A common technique for masking contents of messages or other information traffic so that opponents can not extract the informati
    14·1 answer
  • What is the correct process for selecting an entire row in a spreadsheet?
    8·2 answers
  • Write a Comparator that compares String objects by the number of words they contain. Consider any nonwhitespace string of charac
    15·1 answer
  • The smallest unit of storage is​
    15·1 answer
  • 1. Trust can be built in a relationship if:
    15·1 answer
  • A list is a collection that ______________
    9·1 answer
  • Enthusiasm codehs 7.6.4 Write a function called add_enthusiasm that takes a string and returns that string in all uppercase with
    15·1 answer
  • What are the steps in preparing a bootable USB installer?​
    11·1 answer
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!