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
dimaraw [331]
3 years ago
6

Write a program that asks the user for the number of males and the number of females registered in a class using two separate in

puts ("Enter number of males:", "Enter number of females:"). The program should display the percentage of males and females (round to the nearest whole number) in the following format:
Percent males: 35%
Percent females: 65%

Use string formatting.
Computers and Technology
1 answer:
bagirrra123 [75]3 years ago
6 0

Answer:

males_num=int(input("Enter the number of males\n"))#taking input of the males_num

female_num=int(input("Enter the number of females\n"))#taking input of the female_num

percentage_male=(males_num/(males_num+female_num))*100#calculating the percentage.

print("Percent males: "+str(percentage_male)+"%")#printing the male percentage.

print("Percent females: "+str(100-percentage_male)+"%")#printing the female percentage.

Enter the number of males

21

Enter the number of females

45

Percent males: 31.818181818181817%

Percent females: 68.18181818181819%

Explanation:

The above written code is in python.I have first taken input of the number of males then input of the number of males after that calculating the male percentage in the class.Then calculating the percentage of female students by subtracting the male percentage form 100 that's how we  will get the respective percentages then printing the percentages.

You might be interested in
Ou have an application running on Oracle Cloud Infrastructure. You identified that the read and write operations are slowing you
Otrada [13]

Answer:

Options A and C.

Explanation:

In Oracle Cloud Infrastructure the two options which allows you to increase disk performance are;

1. Terminate the compute instance preserving the boot volume. Create a new compute instance using a VM Dense IO shape using the boot volume preserved.

2. Create a backup of the boot volume. Create a new compute instance a VM Dense IO shape and restore the backup.

3 0
3 years ago
A(n) ________ is a way of retrieving information from one or more tables that defines a particular subset of data.
adoni [48]

Answer:

completeness

Explanation:

5 0
2 years ago
How can I make my Wi-Fi signal fast? I am going through my exam but my Wi-Fi is not supporting plz help.
9966 [12]

Answer: Maybe try to move router.

Explanation:

8 0
3 years ago
A line of code that begins with the while needs to end which symbol?<br> # <br> "<br> :<br> .
olga_2 [115]
<h2>A line of code that begins with the "while" needs to end with <u>":"</u> symbol</h2>

Explanation:

In python, the while loop statement has ":" at the end of the line.

<u>Syntax:</u>

while expression:

code(s) or statement(s)

<u>Example:</u>

cnt = 0

while (cnt < 5):

  print 'cnt:', cnt

  cnt = cnt + 1

Like other programming languages, while loop works in the same way except that in python it comes alone with "else" statement. When the condition is false, "else" statement gets executed.

<u>Example:</u>

#!/usr/bin/python

cnt = 0

while cnt < 5:

  print cnt, " is  less than 5"

  cnt = cnt + 1

else:

  print cnt, " is not less than 5"

3 0
3 years ago
Consider a sequence of 1's and 1's with the property that the sum of any prefix of the sequence is never negative For example th
MrMuchimi

Answer:

Check the explanation

Explanation:

Answer: Solution: Algorithm:

Step 1: Start.

Step 2: Create a stack Step

3: Push an initial stack variable, it will represent that, stack is empty.

Step 4: Get input

             If +1 then push "+1"

             Else if -1 then pop

Step 5: Repeat until all input finish or Stop if empty stack variable popped. Step 6: Stop.

It is a pushdown automata problem.

It can be also represented as:

X =1+1* —1* 1No(+1)>= No(-1)}

4 0
3 years ago
Other questions:
  • g Write a program that prompts the user to enter two integers. The program outputs how many numbers are multiples of 3 and how m
    11·1 answer
  • Which of the following statements is​ FALSE? A. Security is a huge concern for nearly all organizations with private or propriet
    14·1 answer
  • What are the three types of network topologies used today?
    13·1 answer
  • It is essential for a relay energized by alternating current to have
    13·1 answer
  • A printer is connected locally on Computer1 and is shared on the network. Computer2 installs the shared printer and connects to
    10·1 answer
  • A ____ is used to perform a forward-only (sequential) access of the data in the data source while a ____ is used to populate a d
    11·1 answer
  • What are some pros for having your phone during school hours?
    10·2 answers
  • How many sections of a job description are there
    5·1 answer
  • Difference between hardcopy and hardware​
    6·1 answer
  • _________ in online education refer(s) to how fairly the particular needs of particular groups of students are met.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!