Question

In: Computer Science

C# PLEASE Lab7B: For this lab, you’re going to write a program that prompts the user...

C# PLEASE

Lab7B: For this lab, you’re going to write a program that prompts the user for the number of GPAs to enter. The program should then prompt the user to enter the specified number of GPAs. Finally, the program should print out the graduation standing of the students based on their GPAs. Your program should behave like the sample output below.

Sample #1:

Enter the number of GPAs: 5

GPA #0: 3.97

GPA #1: 3.5

GPA #2: 3.499

GPA #3: 3.71

GPA #4: 1.9

Student #0: Summa Pum Laude

Student #1: Pum Laude

Student #2: Graduating

Student #3: Magna Pum Laude

Student #4: Not graduating

Sample #2:

Enter the number of GPAs: 7

GPA #0: 0.03 GPA #1: 4.0

GPA #2: 3.32 GPA #3: 2.81

GPA #4: 3.75 GPA #5: 3.85

GPA #6: 2.3

Student #0: Not graduating

Student #1: Summa Pum Laude

Student #2: Graduating

Student #3: Graduating

Student #4: Magna Pum Laude

Student #5: Magna Pum Laude

Student #6: Graduating

Solutions

Expert Solution

Explanation:

here is the code which asks for the number of GPAs and then the value of the GPAs.

After that, according to the values, it prints the result for each student.

Code:


using System;
class HelloWorld {
static void Main() {
Console.Write("Enter the number of GPAs: ");
int n = Convert.ToInt32(Console.ReadLine());
  
double[] a = new double[n];
  
for(int i=0; i<n; i++)
{
Console.Write("GPA #"+(i)+": ");
a[i] = Convert.ToDouble(Console.ReadLine());
}
  
for(int i=0; i<n; i++)
{
Console.Write("Student #"+(i)+": ");
  
if(a[i]<2)
Console.WriteLine("Not graduating");
else if(a[i]<3.5)
Console.WriteLine("Graduating");
else if(a[i]==3.5)
Console.WriteLine("Pum Laude");
else if(a[i]<3.9)
Console.WriteLine("Magna Pum Laude");
else
Console.WriteLine("Summa Pum Laude");
  
}
}
}


output:

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!

PLEASE COMMENT IF YOU NEED ANY HELP!


Related Solutions

Please Write C++ PROGRAM : That will write a program that initially prompts the user for...
Please Write C++ PROGRAM : That will write a program that initially prompts the user for a file name. If the file is not found, an error message is output, and the program terminates. Otherwise, the program prints each token in the file, and the number of times it appeared, in a well formatted manner. To accomplish all this, do the following: - Open the file - the user must be prompted and a file name input. DO NOT hardcode...
In Java please: 3.39 Lab 6e: CharacterOps Write a program that prompts the user to enter...
In Java please: 3.39 Lab 6e: CharacterOps Write a program that prompts the user to enter their first name. Say hello to the person. Then display whether their name begins with a vowel or consonant. If it is neither, perhaps a special character or a number digit, then print neither a vowel nor a consonant. Example 1: Enter your first name: Barbara Hello, Barbara! The first letter of your name, 'B', is a consonant. Example 2: Enter your first name:...
write this program in C++ Write a program that prompts a user for three characters. The...
write this program in C++ Write a program that prompts a user for three characters. The program must make sure that the input is a number 10 - 100 inclusive. The program must re prompt the user until a correct input is entered. Finally output the largest and the lowest value. Example 1: Input : 10 Input : 20 Input : 30 The largest is 30. The lowest is 10. Example 2: Input : 100 Input : 50 Input :...
Write a C++ Program Write a program that prompts the user to input a string. The...
Write a C++ Program Write a program that prompts the user to input a string. The program then uses the function substr to remove all the vowels from the string. For example, if str=”There”, then after removing all the vowels, str=”Thr”. After removing all the vowels, output the string. Your program must contain a function to remove all the vowels and a function to determine whether a character is a vowel. You must insert the following comments at the beginning...
Please code C# 8. Write a program that prompts the user to enter an integer. The...
Please code C# 8. Write a program that prompts the user to enter an integer. The program then determines and displays the following: Whether the integer is divisible by 5 and 6 Whether the integer is divisible by 5 or 6
Write a C++ program that prompts the user for the radius of a circle and then...
Write a C++ program that prompts the user for the radius of a circle and then calls inline function circleArea to calculate the area of that circle. It should do it repeatedly until the user enters -1. Use the constant value 3.14159 for π Sample: Enter the radius of your circle (-1 to end): 1 Area of circle with radius 1 is 3.14159 Enter the radius of your circle (-1 to end): 2 Area of circle with radius 2 is...
Write a program in C that prompts the user for a number of seconds and then...
Write a program in C that prompts the user for a number of seconds and then converts it to h:m:s format. Example: 5000 seconds should display as 1:23:20 (1 hour, 23 minutes, 20 seconds.) Test with several values between about 100 seconds and 10,000 seconds. use unint and remainders for this and keep it as simple as possible.
C++ Question: write a program that prompts the user for the length and width of a...
C++ Question: write a program that prompts the user for the length and width of a rectangle in inches.  The program then uses functions to compute the perimeter and area of the rectangle and to convert those to meters and square meters respectively. Sample output from one instance of the program is shown below: ```html Welcome to the Foot-To-Meter Rectangle Calculator ================================================= Enter the rectangle length in feet: 2 Enter the rectangle width in feet: 3 The rectangle dimensions are: 0.61...
IN C++ Write a program that prompts the user to enter the number of students and...
IN C++ Write a program that prompts the user to enter the number of students and each student’s name and score, and finally displays the student with the highest score (display the student’s name and score). Also calculate the average score and indicate by how much the highest score differs from the average. Use a while loop. Sample Output Please enter the number of students: 4 Enter the student name: Ben Simmons Enter the score: 70 Enter the student name:...
C++ Program: Write a program that prompts the user for two numbers and stores them in...
C++ Program: Write a program that prompts the user for two numbers and stores them in signed integers. The program should then add those two numbers together and store the result in a signed integer and display the result. Your program should then multiply them by each other and store the result in another integer and display the result. Then do the same but with dividing the first number by the second. Display an error message to the screen if...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT