Create a program that asks that asks the user for the number of males and females in a class. The program should display a percentage of males and females. For example, there are 5 males, and 15 females. That makes 20 people total. To find the percentage of males you can divide 5 by 20, which makes 0.25, or 25% HINT: USE A VARIABLE for every group of people that you will use in your calculation. Submit your .java source code and a screen capture of your program at runtime, including output.

Answers

Answer 1

Answer:

In Java:

import java.util.*;

public class Main{

public static void main(String[] args) {

 int male, female;

 Scanner input = new Scanner(System.in);

 System.out.print("Male: ");

 male = input.nextInt();

 System.out.print("Female: ");

 female = input.nextInt();

 System.out.println("Male%: "+(male*100)/(male+female)+"%");

 System.out.println("Female%: "+(female*100)/(male+female)+"%");   }}

Explanation:

This declares the number of boys and girls as integers

 int male, female;

This prompts the user for number of male

 System.out.print("Male: ");

This gets input for number of male

 male = input.nextInt();

This prompts the user for number of female

 System.out.print("Female: ");

This gets input for number of female

 female = input.nextInt();

This calculates and prints the percentage of male students

 System.out.println("Male%: "+(male*100)/(male+female)+"%");

This calculates and prints the percentage of female students

 System.out.println("Female%: "+(female*100)/(male+female)+"%");  


Related Questions

Jobs with only 7 letters

Answers

Answer:

nursing

Explanation:

it's needs 20 words so don't mind thisssss part hehe

Answer: Teacher!!!!!!

Which of these conclusions supports the fact that Eclipse is categorized as an IDE?


The user cannot use cheat sheets because it is frowned upon.

The user must get used to a proprietary and unique menu system.

The user must specify the programming language he or she wants to use.

The user must have a high level of expertise before quality results can be obtained.

Answers

Answer:

The user must specify the programming language he or she wants to use.

Explanation:

What is the most likely reason a user would export data with the formatting in place?

A) The fields will not have any errors.

B) The file will be much easier to read.

C) The file is automatically spellchecked.

D) The columns are automatically alphabetized.

Answers

Answer:

its d

Explanation:

Answer:

its b on edge

Explanation:

believe me if youre a viber

Amaya is curious how her computer actually boots up. Which of the
following should Amaya research to find out more?
hard drive
O RAM
OROM
O CPU

Answers

She should press OROM

Answer:

Options 1, Ram

Explanation:

That's how a computer works.

If you do not have the latest Java SDK in place when you download the Eclipse IDE, you will have to download the program again.


True

False

Answers

Answer:

True

Explanation:

What is the diagram of a combination circuit that accepts a 3 bit number and generates an output binary number equal to the square of input number?​

Answers

Answer:

see picture

Explanation:

Disclaimer: I didn't design this; I found it.

Search for "3 bit square circuit".

Select the correct statement(s) regarding direct sequence spread spectrum (DSSS) and orthogonal frequency division multiplexing (OFDM).
a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum
b. OFDM has greater spectral efficiency compared to DSSS
c. DSSS relies upon a PN code that is only shared by the transmitter and receiver pair
d. all statements are correct

Answers

Answer:

a. OFDM is not classified as a spread spectrum technique, although OFDM has the effect of spreading the signal over a larger frequency spectrum.

Explanation:

Orthogonal Frequency Division Multiplexing is a technique in which large digital data is sent over radio waves by splitting it into multiple subcarriers. The data is then transmitted to different users who can access the files. OFDM is not a spread spectrum technique, it is based on large frequency spectrum.

Implement a class Quiz that implements the Measurable interface. A quiz has a score and a letter grade (such as B ). Use the implementation of the DataSet class to process a collection of quizzes. Display the average score and the quiz with the highest score (both letter grade and score).

Answers

Answer:

Explanation:

The following code is written in Java. The Measurable Interface and DataSet classes/Interfaces were found and implemented as requested. Then the rest of the code was created to work with and around those two methods to accomplish the task of Display the average score and the quiz with the highest score (both letter grade and score)

package sample;

interface Measurable {

       double getMeasure();

       String getGradeString();

}

class DataSet

{

   private double sum;

   private Measurable maximum;

   private String grade;

   private int count;

   public DataSet()

   {

       sum = 1;

       count = 0;

       maximum = null;

   }

   public void add(Measurable x)

   {

       sum = sum + x.getMeasure();

       if (count == 0 || maximum.getMeasure() < x.getMeasure())

           maximum = x;

           grade = x.getGradeString();

       count++;

   }

   public double getAverage() {

       return sum / count;

   }

   public Measurable getMaximum()

   {

       return maximum;

   }

}

class Quiz implements Measurable

{

   private double score;

   private String grade;

   public Quiz(double aScore, String aGrade)

   {

       this.score = aScore;

       this.grade = aGrade;

   }

   public double getMeasure()

   {

       return score;

   }

   public String getGradeString() {

       return grade;

   }

}

class QuizTester

{

   public static void main(String[] args)

   {

       DataSet quizData = new DataSet();

       Quiz q1 = new Quiz(85, "B");

       Quiz q2 = new Quiz(93, "A-");

       Quiz q3 = new Quiz(78, "C+");

       quizData.add(q1);

       quizData.add(q2);

       quizData.add(q3);

       System.out.println("Maximum: " + quizData.getMaximum().getMeasure() + ",  " + quizData.getMaximum().getGradeString());

       System.out.print("Average: ");

       System.out.printf("%.2f", quizData.getAverage());

   }

}

When handling a project scope creep, which are two things that all parties involved need to be aware of

Answers

Answer:

Additional resource needed for the projects

Additional time needed for the project

Explanation:

In any project handing their will expected diversion and add on requirement, so to complete a project additional time and additional resource is required to finish a project.

As advice due the project details, end user has keep enough buffer for deviations on resource of man power and additional times taken to finish the project.

While design the project each scope of work is measure with additional time to complete the task

Each scope of work is considered as task in project management.

Explanation:

Write a program that will read two floating point numbers (the first read into a variable called first and the second read into a variable called second) and then calls the function swap with the actual parameters first and second. The swap function having formal parameters number1 and number2 should swap the value of the two variables

Answers

Answer:

In Python:

def swap(number1,number2):

   a = number1

   number1 = number2

   number2 = a

   return number1, number2

   

first = float(input("First Number: "))

second = float(input("Second Number: "))

print("After Swap: "+str(swap(first,second)))

Explanation:

The swap function begins here

def swap(number1,number2):

This saves number1 into variable a

   a = number1

This saves number2 into number1

   number1 = number2

This saves a (i.e. the previous number1) to number2

   number2 = a

This returns the numbers (after swap)

   return number1, number2

   

The main begins here

The next two lines prompt the user for first and second numbers

first = float(input("First Number: "))

second = float(input("Second Number: "))

This calls the swap function and print their values after swap

print("After Swap: "+str(swap(first,second)))

in a swap you need a variable so that one of the values is not lost ? Need help

Answers

Answer:

In a swap, the variable is cuttly.x

Explanation:

Answer:

temp

Explanation:

Define the Database ​

Answers

A structured base in a computer

Lena is completing her senior year of college and is living in an apartment with three friends. Her family has a subscription to HBO Go, and Lisa is able to use the log-on ID and password while she’s at college. Lena does not have cable TV or satellite TV as she typically streams shows or movies that are available online for free or through HBO Go. Several of Lena’s friends don’t have a subscription to Hulu, so Lena has given them her log-on ID and password so they can watch their shows. She doesn’t mind sharing the HBO Go subscription with her friends—what could it hurt? She has heard that the entertainment industry and HBO Go are upset over people sharing their subscription to the streaming services in this way. Lena’s sharing of her family’s HBO Go subscription is an example of:________
a) streaming piracy
b) illegal sharing
c) consumer copying
d) consumer misbehavior
e) digital stealing

Answers

Answer:

d) consumer misbehavior

Explanation:

This is an example of consumer misbehavior. What Lena is doing is not technically piracy or illegal because HBO has created the family feature on their accounts for the account to be used by multiple people at the same time. Yet, the feature was not intended to be used by individuals that are not technically family or even under the same roof. Therefore, what Lena is doing goes against HBO's reason for this feature and sharing the account as Lena is doing is ultimately hurting HBO's streaming service.

Suppose you have a sentineled, doubly-linked list class as specified in project 2 and an object of that class called my_list. The function below finds and returns the first index of a specified value in that list, but portions have been removed. Using the minimum possible spacing at all in your answers, fill in the missing code. This algorithm does not employ the __iter__ and __next__ methods of the Linked_List class. Also note that this exercise does not include the object names, so your answers should include my_list. as appropriate. Finally, none of your responses should contain colons. As a reminder, the linked list implementation provides the following methods: insert_element_at(value, index) #cannot be used to append
append_element(value)
get_element_at(index)
remove_element_at(index)
__len__ #support for the len method to obtain the list's size
def index_of(my_list, val):
for k in :
if :
raise ValueError
and what is the performance?

Answers

Answer:

def index_of (my_list, val):

  for k in range(my_list.__len__):

      if my_list.get_element_at(k) == val :  

          return k

Explanation:

The python function "index_of" accepts two arguments, a list and the value to be searched for.

The for-loop iterates over the list using the "__len__" magic method to return the index of the searched term in the list if present.

For this exercise, you are going to create a part of an Animal hierarchy. Unlike some of our examples and the previous exercises, this exercise is going to have 3 levels in the hierachry.
At the top is the Animal class. Below that, we are going to have a subclass for Pets. Under pets, we are going to have 2 subclasses, Dogs and Fish.
You will need to create your class hierarchy and add instance variables, getters, and setter methods to accommodate the following information:
I need to save what type of animal I have (String variable)
I want to be able to save a name for my fish and dog (String variable)
I want to know which fish need salt water v. fresh water (String variable)
I want to know if my dog has been trained (boolean variable)
I want to know the size of my dog and fish (String variable)
Make sure you use common sense names for your variables!
public class Animal
{
}
public class Fish extends Pet public class Pet extends Animal public class Dog extends Pet
{ { {
} } }

Answers

Answer:

vehicle super class 9.1.4

Explanation:

So you need to create a super class containig all the animals use the class above for referance

How Charles Babbage Concept of
Computer has help the modern
Computer​

Answers

English mathematician and inventor Charles Babbage is credited with having conceived the first automatic digital computer. During the mid-1830s Babbage developed plans for the Analytical Engine. Although it was never completed, the Analytical Engine would have had most of the basic elements of the present-day computer.

Which of these titles will work in Java syntax?


hello world

Helloworld

helloworld

HelloWorld

Answers

Answer:

I am pretty sure it is D, "HelloWorld"

Answer:

HelloWorld is the answer

Explanation:

Remember Java syntax for naming projects and classes: begin with a capital letter, and then capitalize the first letter of each new word.

Which of the following characterizes how an enabled security program might react to a new program installation on a computer system?


It might alert you to space requirement excesses.

It might report an error or tell you that the file is corrupted.

It might protect the new installation from getting viruses.

It might automatically set a restore point for the computer system.

Answers

Answer:

It might automatically set a restore point for the computer system

Answer:

It might report an error or tell you that the file is corrupted.

Explanation:

Question #4
Multiple Choice
You are going to open a file in your program.
aFile = open("___", "r")
Which statement is true about what goes in the blank?
O The text file must be in the same folder as the program.
O You can use the relative path to a subfolder within the folder where the program is saved.
O You must use backward slashes.
O The full path needs to be provided.

Answers

Answer:

You can use the relative path to a subfolder within the folder where the program is saved.

Explanation:

edge 2021

please remember to read the questions thoroughly bc in this class they give very similar questions with slight differences.

have a lovely day <3

The true statement about what goes in the blank is you can use the relative path to a subfolder within the folder where the program is saved. The correct option is B.  

What is data file handling?

Data is permanently stored in a storage device using files. The ability to save program output in a file and execute various operations on it is made possible by file handling.

A device's input and output actions are carried out on a stream, which is an abstraction of that device. The method for storing a program's output in a file and assisting with various operations on it is known as file handling in C++.

These data are stored permanently on a storage device thanks to files. Known facts or information are frequently referred to as "data."

Therefore, the correct option is B. You can use the relative path to a subfolder within the folder where the program is saved.

To learn more about data file handling, refer to the link:

https://brainly.com/question/29524491

#SPJ5

Use the drop-down menus to match each description to the correct term.

Has records and fields:
Has columns and rows:
Enables a user to interact with a database without working directly with data:
Works like a dialog box:
An interface that makes it easier for inputting data into a database:
Enables you to search several tables for data:

Answers

The application software Cermine is used to record data, query the database to find specified data, format the display of a database object, and search for data entry. Other part of the question is discussed below:

What are the perfect match of the given words?

Application Software Cermine: Matching the items with the best options

To answer this question, you need to match each description on the left with the corresponding item on the right:

The first description is "A collection of records" which matches with "record".

The second description is "A data retrieval tool that finds specified data within a database" and this matches with "query".

The third description is "The display format that you choose when working with a database object on the screen" and this matches with "form".

The fourth description is "All of the fields for a single database entity" and this matches with "record".

The last description is "A data entry tool you use to input data into a database" and this matches with "Search".

Therefore, The application software Cermine is used to record data, query the database to find specified data, format the display of a database object, and search for data entry.

Learn more about Programming:

brainly.com/question/23275071

#SPJ3

a worldwide system of computer network​

Answers

Answer:

The internet is a worldwide system of computer network.

What are the uses of an interface in encapsulation?

Answers

Answer:

As you can see in the above examples, encapsulation is implemented in Java using interfaces, classes, access modifiers, setters and getters. A class or an interface encapsulates essential features of an object. Access modifiers (private, public, protected) restrict access to data at different levels. I don't know If this helps

Ans: As you can see in the above examples, encapsulation is implemented in Java using interfaces, classes, access modifiers, setters and getters. A class or an interface encapsulates essential features of an object. Access modifiers (private, public, protected) restrict access to data at different levels.

Which file type is used when forwarding a contact as a business card to another user to share their information?
PST
CSV
XML
VCF

Answers

Answer:

VCF

Explanation:

Answer:VCF

Explanation:

Which equipment is a standalone recorder?

Answers

Answer:

i think its Pro tool

Hopes it helps you

What are some common predefined number formats used in the United States? Check all that apply.
ratings
zip codes
kilograms
phone numbers
Social Security numbers
employee numbers

Answers

Answer:

B)__(Zip Codes)

D)__(Phone Numbers)

E)__(Social Security Numbers)

7. Write a python program to get the following output.
1-----99
2-----98
3-----97
. .
. .
. .
98-----2
99-----1
whats is the code of this question

Answers

Answer:

for i in range(1,100):

print(f"{i}-----{100 - i}")

OR:

for i in range(1,100):

print(str(i)+"-----"+str(100 - i)")

Explanation:

First off, we can see that the program starts off with an iteration of 1 and ends at 100. So we use this loop code to begin:

for i in range(1,100):

Then, we use this code to print the pattern (make sure to indent this):

print(str(i)+"-----"+str(100 - i)")

We can also use f-strings as a better and cleaner alternative (make sure to indent this too):

print(f"{i}-----{100 - i}")

This code will get us the output shown in the question.

How is binary used in pixels and in sound?

Answers

Answer:

Sound needs to be converted into binary for computers to be able to process it. To do this, sound is captured - usually by a microphone - and then converted into a digital signal. The samples can then be converted to binary. They will be recorded to the nearest whole number.

Explanation:

is this it?

Answer:

Sound needs to be converted to binary.

What are examples of Table Tools options that can help edit data?

Answers

Answer:

1 - change views

2 - change fonts

3 - add controls

4 - insert rows and columns

5 - add existing fields

6 - change margins

7 - view the property sheet

8 - change padding

Answer:

properties

add and delete

before change

Explanation:

1. Mrs. Bautista has a bank balance of -42 dollars at the start of the month. After she
deposits 6 dollars, what is the new balance?​

Answers

Answer:

- 36

Explanation:

-42 + 6 = -36

Mrs. Bautista is kinda broke

What are some common uses of Excel?

Answers

Answer:

to make a spread sheet and to make sure you have all of the sum and didn[t miss a number

Explanation:

Other Questions
ocean high tides are an example of a 1 contact 2 non contract 3 neither. force Explain how one executive branch power serves as a check on court decisions. Excerpt from Norse Mythology Part C Kate McConnaughey To the north of Ginnungagap it was bitterly cold. Nothing was there but fields of snow and mountains made of ice. To the south of Ginnungagap was a region where frost and snow were never seen. It was always bright, and was the home of light and heat. The sunshine from the South melted the ice mountains of the North so that they toppled over and fell into Ginnungagap. (21) They were changed into a frost giant whose name was Ymir (emir). He had three sons. They and their father were so strong that the gods were afraid of them. Read the passage. Look at the underlined section marked number (21). There may be a mistake in the way the sentence is written. If you find a mistake, choose the answer that corrects the mistake. If there is no mistake, choose Correct as is.A) Correct as is. B) There they were changed into a frost giant whose name was Ymir (emir). C) At last they were changed into a frost giant whose name was Ymir (emir).D) However, they were changed into a frost giant whose name was Ymir (emir). Can someone please help i dont get what to do after the third step Which bond occurs between two metal atoms? What was a significant problem with the Articles of Confederation? A single card is drawn from a standard deck of cards. Find the probability if the given information is known about the chosen card. (Enter the probability as a fraction.) P(queen|black) 7.05 as a fraction and as a percent "We'll Meet again don't know where don't know when oh I know we'll meet again some sunny day""Wh-Where am I?""Your in the penthouse suite kid, The tip of the pyramid Have a drink make yourself comfortable""You know that couch is made from living human skin?""AH, Quit the games Cipher!" Help please ::)))))........................ How did the feudal social structure system unfairly distribute power in Japan? in your own words, please!!! * 4.In a hydroelectric power plant, 100 m3/s of water flows from an elevation of 120 m to a turbine, where electric power is generated. The electric power you get out from the 80% efficiency turbine is known to be 50 MW, what is the rate of irreversible loss in the piping system (in MW unit) What is the speed of a shark that traveled 15 miles in 1 hour What percent of 5,000 is 5 Type the words from the spelling list in which the / er / sound appears.acquaintance addressee apprise code words conceal dialogue editorial form gesture speechimply indent infer literal logical margin nonverbal reliance salutation shadesourcestationery structure title vibration viewpoint 2.what note would you add to make this an f-minor triad use the picture to answerA AB DC A flatD D flat Which of the following solar phenomena is likely to have the most negative impact on Earth? A solar flare as it may cause brief radio blackouts An aurora as it may damage communication networks An aurora as it may cause worldwide transmission problems A solar flare as it may harm satellites and aircrafts flying near poles Please helpMe I dont know the answers pleasee A. Why did Horace Mann believe that reforming the educational system was important to the future of the United States? what piece of legislation completely ended separate but equal ?