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
andrey2020 [161]
3 years ago
7

Your manager has asked you to write a program that displays the percentage of males and female in your class. The program should

prompt the user to enter the number of males and females and display the results.
Computers and Technology
1 answer:
Blababa [14]3 years ago
7 0

<u>Explanation:</u>

The program using <em>python programming language </em>would be:

First, we write the Input prompt.

<u>Input  prompt for the user</u>

number_of_males_in_class = int (input ('Enter the number of males: '))

number_of_females_in_class = int(input('Enter the number of females: '))

Next, we write the Process algorithm.

<u>Process  algorithm</u>

total_number_of_students_in_class = number_of_females_in_class + number_of_males

_in_class

percentage_of_males_in_class = number_of_males_in_class / total_number_of_students

_in_class

percentage_of_females_in_class = number_of_females / total_number_of_students

Finally, the Output process

<u>Output process</u>

print('Total number of males in class =', format(percentage_of_males_in_class, '.0%'))

print('Total number of females =', format(percentage_of_females_in_class, '.0%'))

You might be interested in
In the Mouse Properties window, you can?
Levart [38]
Answer: option A. adjust the mouse's double-click speed.

You can see it in the attached file.


Download pdf
3 0
3 years ago
How do I find a space in my String and replace it? JAVA
Fantom [35]

Answer:

This article shows how to use regex to remove spaces in between a String.

A string with spaces in between.

String text = "Hello World Java.";

We want to remove the spaces and display it as below:

Hello World Java.

1. Java regex remove spaces

In Java, we can use regex \\s+ to match whitespace characters, and replaceAll("\\s+", " ") to replace them with a single space.

Regex explanation.

`\\s` # Matches whitespace characters.

+ # One or more

StringRemoveSpaces.java

package com.mkyong.regex.string;

public class StringRemoveSpaces {

public static void main(String[] args) {

String text = "Hello World Java.";

String result = text.replaceAll("\\s+", " ");

System.out.println(result);

}

}

Output

Terminal

Hello World Java.

8 0
3 years ago
Write statements that output variable numComputers as follows. End with a newline
gavmur [86]

Complete Question:

Write statements that output variable numComputers as follows. End with a newline. There are 10 computers.

#include <iostream>

using namespace std;

int main()

{

int numComputers;

cin >> numComputers; // Program will be tested with values: 10.

...

return 0;

}

Answer:

cout << "There are ";

cout << numComputers;

cout << " computers." << "\n";

Explanation:

Using three cout statements the string "There are 10 computers." is printed out, notice that the variable numComputers is entered by the user when the program is run. Another way of concatenating an integer variable and string for printout is by the use of the + (plus) operator.

8 0
3 years ago
What happens when your project is rendered?
jok3333 [9.3K]

Answer:

B

Explanation:

when your rendering video project your computer is processing all the data that goes into creating images you experience video rendering every time you look at your computer the images on your screen has all been rendered to produce the website photo or video you are looking at

4 0
2 years ago
Cuáles son las partes más importantes de una flor​
castortr0y [4]

Answer:

estas son

Explanation:

El cáliz. Está formado por los sépalos, que son un conjunto de hojas verdes en la base de la flor.

La corola. Está formada por los pétalos que son hojas coloreadas en el interior de los sépalos.

Los estambres. Son los órganos masculinos de la flor. ...

El pistilo. Es el órgano femenino de la flor.

7 0
3 years ago
Other questions:
  • Provide Java code to illustrate how to create an array, reference an array, and address an element of an array.
    13·1 answer
  • 2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
    11·1 answer
  • 2. What's the keyboard command that will allow you to "copy" text?
    8·2 answers
  • Technician A says that the push rod connects to a pivoting component mounted at the top of the cylinder head called the camshaft
    14·2 answers
  • What are the features of the Outline view in Word? Select three options.
    12·2 answers
  • When a Python program is reading a file, the data is input as plain ASCII characters in a string. What is the following code doi
    15·1 answer
  • Wide area network (WAN) connects multiple networks that are in the same geographical locations.
    6·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • What is the difference between the byte and short data types in Java?
    7·1 answer
  • A web site that contains large numbers of misspelled words and grammatical errors fails which of these general criteria?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!