Write a program that will input letter grades (A, B, C, D, F), the number of which is input by the user (a maximum of 50 grades). The grades will be read into an array. A function will be called five times (once for each letter grade) and will return the total number of grades in that category. The input to the function will include the array, number of elements in the array and the letter category (A, B, C, D or F). The pro- gram will print the number of grades that are A, B, etc.

Answers

Answer 1

Answer:

In Java:

import java.util.*;

public class Main{

public static int countgrades(char[]letterGrades,char Grade, int lent){

    int count = 0;

    for(int i =0;i<lent;i++){

        if(letterGrades[i]==Grade){

            count++;         }     }

    return count;

}

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int lent;

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

 lent = input.nextInt();

 while(lent >30 || lent<1){

     System.out.print("Invalid input\nLength: ");

     lent = input.nextInt();  }

 char[] letterGrades = new char[lent];

 for(int i  =0; i<lent;i++){

     letterGrades[i] = input.next().charAt(0);

 }

 char[] letters = {'A','B','C','D','F'};

 for(char i:letters){

     System.out.println(i+": "+countgrades(letterGrades,i, lent));

 }

}

}

Explanation:

See attachment where I I used comment to explain each lin e

Answer 2

Following are the code to the given question:

Program Explanation:

Include header file.Defining a method "count_Char" that takes three variable in the parameter that are "g as character array, x as integer variable, and a character variable l".Inside the method two integer variable "i,s" is declared.In the next step, a for loop is declared that use if block that checks input value is in array and return incremented s value.In the next line, a main method is declared inside this two integer variable "i,x" and  two character array is declared that inputs value, and define a loop that call the above method, and print its value.

Program:

#include <iostream>//header file

using namespace std;

int count_Char(char g[], int x, char l)//defining a method count_Char that takes 3 variable in parameter

{

int i,s=0;//defining integer variable

for(i=0;i<x;i++)//defining for loop that checks input value find in array

{

  if(g[i]==l)//defining if block that check value is in array

   {  

       s++;//incrementing s value by 1

   }

}

return s;//return s value

}  

int main()//defining main method

{

int i,x;//defining integer variable

char g[50],l[5]={'A','B','C','D','F'};//defining 2 character array

cout<<"Please input the number of grades to be read in.(1-50): ";//print message

cin>>x;//input integer value

cout<<"all grades must be upper case A B C D or F\n";//print message

for(i=0;i<x;i++)//defining loop that Input array value

{

cout<<"Input a grade: ";//print message

cin>>g[i];//input array value

}

for(i=0;i<5;i++)//defining loop that prints array value and prints its match value

{  

cout<<"Number of "<<l[i]<<"s ="<<count_Char(g,x,l[i])<<endl;//prints array value with matched value

}

return 0;

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/19512947

Write A Program That Will Input Letter Grades (A, B, C, D, F), The Number Of Which Is Input By The User

Related Questions

You are a visitor at a political convention with delegates; each delegate is a member of exactly one political party. It is impossible to tell which political party any delegate belongs to; in particular, you will be summarily ejected from the convention if you ask. However, you can determine whether any pair of delegates belong to the same party or not simply by introducing them to each other. Members of the same party always greet each other with smiles and friendly handshakes; members of different parties always greet each other with angry stares and insults.

Required:
Suppose more than half of the delegates belong to the same political party. Design a divide and conquer algorithm that identifies all member of this majority party and analyze the running time of your algorithm.

Answers

Answer:

The algorithm is as follows:

Step 1: Start

Step 2: Parties = [All delegates in the party]

Step 3: Lent = Count(Parties)

Step 4: Individual = 0

Step 5: Index = 1

Step 6: For I in Lent:

Step 6.1: If Parties[Individual] == Parties[I]:

Step 6.1.1: Index = Index + 1

Step 6.2: Else:

Step 6.2.1 If Index == 0:

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

Step 7: Else

Step 7.1: Index = Index - 1

Step 8: Print(Party[Individual])

Step 9: Stop

Explanation:

The algorithm begins here

Step 1: Start

This gets the political parties as a list

Step 2: Parties = [All delegates in the party]

This counts the number of delegates i.e. the length of the list

Step 3: Lent = Count(Parties)

This initializes the first individual you come in contact with, to delegate 0 [list index begins from 0]

Step 4: Individual = 0

The next person on the list is set to index 1

Step 5: Index = 1

This begins an iteration

Step 6: For I in Lent:

If Parties[Individual] greets, shakes or smile to Party[i]

Step 6.1: If Parties[Individual] == Parties[I]:

Then they belong to the same party. Increment count by 1

Step 6.1.1: Index = Index + 1

If otherwise

Step 6.2: Else:

This checks if the first person is still in check

Step 6.2.1 If Index == 0:

If yes, the iteration is shifted up

Step 6.2.2: Individual = I

Step 6.2.3: Index = 1

If the first person is not being checked

Step 7: Else

The index is reduced by 1

Step 7.1: Index = Index - 1

This prints the highest occurrence party

Step 8: Print(Party[Individual])

This ends the algorithm

Step 9: Stop

The algorithm, implemented in Python is added as an attachment

Because there is an iteration which performs repetitive operation, the algorithm running time is: O(n)

*When a computer programmer is finished writing or developing a program, what has to happen first before the computer can understand and utilize the code?
A.a service pack needs to be applied to the newly created program
B.the object code has to be translated into source code C.the source code has to be translated into object code
D.a device driver for the program has to be installed E.the programmer needs to obtain a software license

Answers

Answer:

C. The source code has to be translated into object code.

Junie is researching Ancient Egypt. She found a website that is full of information and great
images. As she is reading the text, she notices that there are little bits of information that don't
really agree with any of the other research she has done. What should she do?
O Use the website. Most of the information seems correct.
OUse only the information that she needs and ignore the information that doesn't seem right.
O Ask her friend what he thinks about the website.
O Evaluate the site using the CARS checklist to see if the site is valid and reliable.

Answers

Answer: Evaluate the site using the CARS checklist to see if the site is valid and reliable.

Explanation:

6. A rental car agency classifies the vehicles it rents into four categories: compact, midsize, full-size, and sport utility. The agency wants to record the following data for all vehicles: Vehicle_ID, Model, Year, and Color. There are no unique attributes for any of the four classes of vehicle. The entity type vehicle has a relationship (named Rents) with a customer entity type. None of the four vehicle classes has a unique relationship with an entity type. Would you consider creating a class/subclass relationship

Answers

Answer:

there are no possibilities

Explanation:

A class / subclass relatonship is not going to be possible here.

This is because we have these four caegories namely

1. compact,

2. midsize,

3. full-size, and

4. sport utility

These four categories have no real unique relationship or attributes with an entity type. A minimum of a supertype has atleast one subtype as well as following the total specialization situation.

Match the hardware device with the "category" into which it falls. Remember to choose
the main function of the device.
SSD
O Storage
O Processing
O Output
O Input
O Other -- on the computer but doesn't fit neatly into a category
O Communication to external peripheral or device

Answers

A, Storage, basically it collects data and stores it for future use. Hope this helps, have a great day.

What is output if the user enters -5?
What is the output if the user enters 7? Edhesive 7.4 Lesson Practice

Answers

Answer:

for question 3 answer : 4               question4: its 28

Explanation:

x+7*2

The output if the user enters -5 is 4, while the output if the user enters 7 is 28. Both of these outputs will eventually depend on the program which is executed by a specific language.

What is the significance of the output of programming language?

Programming languages use classes and functions that control commands. The reason that programming is so important is that it directs a computer to complete these commands over and over again, so people do not have to do the task repeatedly. Instead, the software can do it automatically and accurately.

According to the context of this question, the actual number is the first output is found to be 1 and when -5 is added into it, it gives an output of 4. The same principle is applied in the second question as well but the actual number, in this case, would be different to it determines a different output.

Therefore, the output if the user enters -5 is 4, while the output if the user enters 7 is 28. Both of these outputs will eventually depend on the program which is executed by a specific language.

To learn more about Programming languages, refer to the link:

https://brainly.com/question/16936315

#SPJ2

From the practice directory, you wish to capture a listing of files and directories to a file in your user2 directory, thus allowing you to keep track of what is in your user2 directory. What command would you use to redirect the output of a long listing of all files and directories under user2 directory and save the result to a new output file called homedir.list which is under the practice directory

Answers

Answer:

variable(s) determine the amount of potential energy an object has?

Explanation:

You took your economic stimulus money, bought a used cargo van, and started the AAA Delivery Service. You decided you wanted to stay local so you were only interested in local deliveries, or deliveries not too far away.

Please answer

It is a computer programming

Answers

Answer: You find a AAA office and apply telling them you only accept local or nearby services.

Explanation:

Read these sentences from the passage:
“The TV and the glasses work together. When the TV flashes the image meant for the right eye, the right lens is clear and the left lens is dark.

Which of the following describes the relationship between the first and second sentence?

Answers

Answer

It is B

Explanation:

Answer:

It's giving further information

Explanation:

A gui allows you to interact with objects on the screen such as icons and buttons true or false

Answers

Answer:

True

Explanation:

How do computers solve complex problems?

Answers

Answer:

Computers solve complex problems by coding

Explanation:

I hope this helps

Hadley made a plan that after downloading the Eclipse IDE, she would disable her security program, extract and install Eclipse, and then update her Java SDK. Which steps will ensure that she will correctly install the new program?


Extract and install Eclipse before disabling her security program.

Re-enable her security program before updating the Java SDK.

Update her Java SDK, then extract the Eclipse IDE.

Disable her security program and update her Java SDK before downloading Eclipse.

Answers

Answer:

Disable her security program and update her Java SDK before downloading Eclipse

Explanation:

Answer:

i believe its late to answer but hi lol

Explanation:

sdjinsn

Which item follows HTML instructions to assemble web pages?

o Client
o Search Engine
o Web Browser
o Web Server

Answers

The answer is web server

Fur or feathers I am in 4th grade

Answers

Answer:

Fur

Explanation:

Fur is a thick hair that covers some animals like rabbit or bear feathers are light and soft part of bird that grow from the skin

Write a program in file MinMax.py that accepts an arbitrary number of integer inputs from the user and prints out the minimum and maximum of the numbers entered. The user will end the input loop by typing in the string 'stop'. When the user enters 'stop' your program should print out the minimum integer entered and the maximum integer entered. If the user enters 'stop' immediately (i.e., before any numbers are entered), you'll print a slightly different message. See the examples below: You can assume that the values entered are integers (positive, negative or zero) or the string 'stop' (lowercase). You don't have to validate the inputs. > python Min Max. py
Enter an integer or 'stop' to end: stop You didn't enter any numbers > python Min Max. py
Enter an integer or 'stop' to end: -10
Enter an integer or 'stop' to end: 0 Enter an integer or 'stop' to end: +42
Enter an integer or 'stop' to end: 87 Enter an integer or 'stop' to end: -100
Enter an integer or 'stop' to end: stop The maximum is 87 The minimum is -100

Answers

Answer:

The program is as follows:

numlist = []

num = input("'stop' to end: ")

while not (num == "stop"):

   numlist.append(int(num))

   num = input("'stop' to end: ")

   

if len(numlist) == 0:

   print("You didn't enter any numbers")

else:

   print("The maximum is "+str(max(numlist))+" and The minimum is "+str(min(numlist)))

Explanation:

This declares an empty list

numlist = []

This prompts the user for input

num = input("'stop' to end: ")

This loop is repeated until the user enters 'stop'

while not (num == "stop"):

This appends the input to the list

   numlist .append(int(num))

This prompts the user for input

   num = input("'stop' to end: ")

   

If the length of the list is 0, then the user entered no input

if len(numlist) == 0:

   print("You didn't enter any numbers")

If otherwise, this prints the min and the max

else:

   print("The maximum is "+str(max(numlist))+" and The minimum is "+str(min(numlist)))

The program that accepts an arbitrary number of integer inputs from the user and prints out the minimum and maximum of the numbers entered is as follows:

numbers = []

x = input("Enter an integer and stop to end: ")

while not(x == "stop"):

    numbers.append(int(x))

    x = input("Enter an integer and stop to end: ")

if len(numbers) == 0:

    print("You didn't enter any numbers ")

else:

    print(f"The maximum number is {max(numbers)} and the minimum number is {min(numbers)}")

Code explanation:

The code is written in python

The first line of code, we declared a variable named numbers and it is an empty list for storing our integers.The variable x is stores the user inputwhile the user's input is not lowercase "stop", the user's input is appended to numbers. Then the program ask for the users input as long as it is an integers inputif the length of the list is 0, then we print a statement to ask the user to enter a number.Else we print the maximum and minimum number of the user's input.

learn more on python code here: https://brainly.com/question/19175881

What is the name for a piece of information from one record in one field ?

Answers

Answer:

Database field

Explanation:

A database sector corresponds to a specific piece of information from some kind of record. A database record consists of a collection of fields. Name, email, and contact information, for example, are fields in a telephone book record. 

Answer: C. Data Value

Explanation:

Intro to Access -Edg2022

An update log file contains the following information:

LogID Old.Name Old.Phone Old.City New.Name New.Phone New.City UpdateTimeStamp
15 Steve Gleason 212 834- 2345 Brooklyn Steven Gleason 212 834- 2345 NJ 01/21/22 07:02:09 UTC
16 Mabel Zurich 315 332 3833 Morristown Mabel Lee 315 332- 833 Camden 01/21/22 07:02:29 UTC
17 Juan Moroni 646 257- 7455 Bronx Juan Moroni 646 257- 7455 Long Island Jan. 21 2022 07:03:02 UTC

For LoglD 17 which of the following data structure issues are present?
a. Data parsing.
b. Cryptic data values.
c. Misfielded values.
d. Data consistency.
e. Data concatenation

Answers

Cooollll very goodnight

can someone help me find all the solutions to the problem ​

Answers

Answer this with the dots connected. Why is it. You may ask? I bet it’s 40
It’s 40 hope this helps

An asset is any ___
that can be composited on top of a video.

Answers

Answer:

clip/edit and or photo

Explanation:

are the raw project assets (video or audio streams) that are created or ... is an NLE background process that occurs when certain types of edits are ... is the audio version of compositing—the act of combining multiple audio ... serves as a mask when superimposing one image over top of another.

what is the difference between multimedia and hypermedia​

Answers

Answer:

While multimedia simply refers to multiple forms of media, hypermedia is used in a much broader sense to refer to media with links to other media. Multimedia is anything you can see and hear, whereas hypermedia is something you can see and interact with at the same time.

Write a Java program that prompts for integers and displays them in binary. Sample output: Do you want to start(Y/N): y Enter an integer and I will convert it to binary code: 16 You entered 16. 16 in binary is 10000. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 123 You entered 123. 123 in binary is 1111011. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 359 You entered 359. 359 in binary is 101100111. Do you want to continue(Y/N): y Enter an integer and I will convert it to binary code: 1024 You entered 1024. 1024 in binary is 10000000000. Do you want to continue(Y/N): n

Answers

Answer:

Explanation:

The following code is written in Java and creates a loop that cycles the same prompt until the user states no. While the loop runs it asks the user for an integer value and returns the binary code of that value

public static void main(String[] args) {

               Scanner in = new Scanner(System.in);

               boolean continueLoop = true;

               while (continueLoop) {

                   System.out.println("Would you like to continue? Y/N");

                   String answer = in.nextLine().toLowerCase();

                   if (answer.equals("y")) {

                       System.out.println("Enter int value: ");

                       int number = in.nextInt();

                       System.out.println("Integer: "+number);

                       System.out.println("Binary = " + Integer.toBinaryString(number));

                   } else if (answer.equals("n")){

                       System.out.println("breaking");

                       break;

                   }

               }

       }

By itself, the human eye cannot see anything in three dimensions. What does the passage say enables us to see the world in 3-D?

Answers

Answer:

he miracle of our depth perception comes from our brain's ability to put together two 2D images in such a way as to extrapolate depth. This is called stereoscopic vision.

Explanation:

Answer:

the way our brain and eyes work together

Explanation:

Question 4
1 pts
Consider the following procedure called square that is meant to multiply a number by
itself and return the value.
PROCEDURE square number
Missing Instructions
RETURN squared
What should go in place of missing Instructions in order to make this procedure work as
intended?
number
number * number
O squared
number + 2
O squared - number number
O square - number number

Answers

Answer: squared ← number * number

Explanation:

Which is a potential disadvantage of emerging technologies? A. increased spread of misinformation due to advanced communication technologies B. inefficient usage of energy due to advanced manufacturing technologies C. only benefiting developed countries rather than developing ones D. slowing down global economic growth

Answers

Answer: I believe it’s D.

Explanation: Less developed countries may not be able to afford the new technology, while more developed ones will be able to do so. Meaning the less developed countries will most likely not change.

The cat store needs your help! The base class Animal has private fields animalName, and animalAge. The derived class Cat extends the Animal class and includes a private field for catBreed. Complete main() to:
create a generic animal and print information using printInfo().
create a Cat animal, use printInfo() to print information, and add a statement to print the cat's breed using the getBreed() method.
Ex. If the input is:
Dobby
2
Kreacher
3
Maine Coon
the output is:
Pet Information:
Name: Dobby
Age: 2
Pet Information:
Name: Kreacher
Age: 3
Breed: Maine Coon
AnimalIformation.java
import java.util.Scanner;
public class AnimalInformation {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
Animal myAnimal = new Animal();
Cat myCat = new Cat();
String animalName, catName, catBreed;
int animalAge, catAge;
animalName = scnr.nextLine();
animalAge = scnr.nextInt();
scnr.nextLine();
catName = scnr.next();
catAge = scnr.nextInt();
scnr.nextLine();
catBreed = scnr.nextLine();
// TODO: Create generic animal (using animalName, animalAge) and then call printInfo
// TODO: Create cat animal (using catName, catAge, catBreed) and then call printInfo
// TODO: Use getBreed(), to output the breed of the cat
}
}
Animal.java
public class Animal {
protected String animalName;
protected int animalAge;
public void setName(String userName) {
animalName = userName;
}
public String getName() {
return animalName;
}
public void setAge(int userAge) {
animalAge = userAge;
}
public int getAge() {
return animalAge;
}
public void printInfo() {
System.out.println("Animal Information: ");
System.out.println(" Name: " + animalName);
System.out.println(" Age: " + animalAge);
}
}
Cat.java
public class Cat extends Animal {
private String catBreed;
public void setBreed(String userBreed) {
catBreed = userBreed;
}
public String getBreed() {
return catBreed;
}
}

Answers

Answer:

Answered below

Explanation:

//TODO1

myAnimal.setName(animalName);

myAnimal.setAge(animalAge);

myAnimal.printInfo();

//TODO2

myCat.setName(catName);

myCat.setAge(catAge);

myCat.setBreed(catBreed);

myCat.printInfo();

//TODO

//Call the getter method of the cat class and //save the returned string in a variable to print //it out.

String breed = myCat.getBreed();

System.out.print(breed);

The pointer to the dynamic array is called data, and the size of the dynamic array is stored in a private member variable called capacity. Write the following new member function: (C++ LANGUAGE)

void bag::triple_capacity( )
// Postcondition: The capacity of the bag's dynamic array has been
// tripled. The bag still contains the same items that it previously
// had.

Do not use the reserve function, do not use realloc, and do not cause a heap leak. Do make sure that both data and capacity have new values that correctly indicate the new larger array.

Answers

Answer:

Following are code to this question:

void bag::triple_capacity()//defining a method bag that uses the scope resolution operator to hold triple_capacity  

{

int* newArray = new int[3*capacity];//defining an array that holds capacity value

for(int x=0;x<capacity;x++)//defining for loop to hold array value

{

newArray[x] = data[x];//holding array value in newArray

}

delete[] data;//using the delete keyword to delete value in array  

data = newArray;//holding array value in data

capacity = capacity*3;//increaing the array size value

}

Explanation:

In this code, a method "bag" is declared that uses the scope resolution operator that holds the triple_capacity method, inside the method an array "newArray" is declared that uses the for loop to hold array value.

In the next step, the delete keyword is declared that delete data value and hold newArray value within it and at the last, it increases the capacity of the array.

to assign length and breadth to display area of a rectangle​

Answers

Answer:

In Python:

Length = float(input("Length: "))

Breadth = float(input("Breadth: "))

Area = Length * Breadth

Print(Area)

Explanation:

Get values for length and breadth

Length = float(input("Length: "))

Breadth = float(input("Breadth: "))

Calculate area

Area = Length * Breadth

Print area

Print(Area)

a debate about city schools are more better than village schools​

Answers

No it is not because village school is the traditional education

GIVING BRAINLIEST ANSWER CORRECTLY! 20 POINTS


What is the purpose of a Post Mortem Review?

To check the code for spelling
To prove the algorithm is correct
To understand how the code can be improved
To check the code for formatting?

Answers

to understand how the code can be improved

Answer:

C . To understand how the code can be improved

Fill in the blank with the correct response.
Your Java class should be given the same name as your Java
.

Answers

Answer:

program

Explanation:

Other Questions
Yi Min owns a small store. The first month the store wasopen, she made $1,375 in profit. During the next month, sheadvertised in the local newspaper and saw a 60% increasein profit. How much profit did she make the second month? PLEASE HURRY! 2 1/3 divided by 2/5 write the meaning in English please answer this Question 7True or FalseThe ordered pair (-3,-7) is a solution to the following system.y = 4x + 5y = 2 - 4TrueO False Given that -5 is a zero of the function f(x) = x^3 + x^2 - 14x + 30 find the remaining zeros imma give brainliestIf opposite sides are congruent (but not all sides are equal) and diagonals are congruent then the quadrilateral is a______ Find the LCM of 4 and 9A. 9B. 35C. 72D. none of the above help please due asap!! cynthia needs to cover the entire surface of this cone with a new coat of paint. what is the minimum amount she will need? PLZ answer fast will give brainliest!!! Even if you can only answer one of the questions it would be appreciated.a) Describe the differences between the R groups of the amino acids located in the transmembrane domains and those located in the amino- or carboxy-terminus of TRPV1. Describe the specific location in the cell where TRPV1 protein is synthesized.(b) The pGoG protein leads to the inhibition of cyclin activity. Explain how this interferes with cell cycle progression.(c) Researchers discover a mutation that prevents NFAT2 from being phosphorylated. Predict the effect of this mutation on apoptosis by the pathway shown in Figure 2. Provide reasoning to justify your prediction.(d) The drug cyclosporin A is known to inhibit calcineurin. Researchers claim that cyclosporin A should not be given to patients with cancer. Support the researchers' claim based on the pathway shown in Figure 2. Pine trees have cones containing exposed seeds and are considered (blank) The average starting salary for a college graduate is approximately $50,000. What percentage of student loan borrowers have LESS than $50,000 in debt? 2. How did the U.S. give support to Europe before it became involved in WWI?A. Through the Lend-Lease ActB. Through the Monroe DoctrineC. Through the Roosevelt CorollaryD. Through the Fourteen Points What can be concluded about aapply.cylinder and a conecone with the same height and radius measures? Check all thatD The cone has the greater volume.The cone and cylinder have thesame base area.The volume of the cone is3the volume of the cylinder.CD The cylinder can fit inside the cone.The cone and cylinder have the same diameter. PLS HELP MEH!!!! Sound travels fastest ina) air b) water c) glass d) diamond WILL MARK BRAINLIEST IF ANSWER Which was the better city-state in ancient Greece, Athens or Sparta? Please the whole page 50 Points each. Please don't steal my points just because A 95-kg astronaut is stranded from his space shuttle. He throws a 2-kg hammer away from the shuttle with a velocity of 19 m/s. How fast will he be propelled toward the shuttle, in m/s? (Round your answer to one decimal place if necessary.) PLEASE HELP!The _______ pulls on the water facing the moon creating a __________. Question 1 options:gravitational force, low tide tidal bulge, gravitational force gravitational force, tidal bulgelow tide, gravitational force Shawn's parents are on a limited budget and want to save as much money as they can on the trip. Which of the following can they do to save more money? A. schedule an itinerary of all the things they want to do on the trip B. buy business-class tickets to Miami and drive to Orlando C. try to convince the airline to overbook their flight to Orlando D. purchase economy-class airline tickets for the family to Orlando