Question

I'm a beginner and have no clue in programming. Please I need help. 2. You are...

I'm a beginner and have no clue in programming. Please I need help.

2. You are given a list of students’ names and their test scores. Design an algorithm that does the following:

a. Calculates the average test scores.

b. Determines and prints the names of all the students whose test scores are below the average test score.

c. Determines the highest test score.

d. Prints the names of all the students whose test scores are the same as the highest test score.

(Each of the parts a, b, c, and d must be solved as a subproblem. The main algorithm combines the solutions of the subproblems.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Output will be like:

I have given a sample algorithm check it out here:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace listOfStudentsAlgorithm
{
class Program
{
static void Main(string[] args)
{
string[] names = { "Nayan", "Andrea", "ALia","jeera","mala","ramya" };
int []scores={56,78,98,67,98,43};
double avg = scores.Average();
Console.WriteLine("The average test score is " + avg);
Console.WriteLine("NAmes with the less than the average ");
for(int i=0;i<6;i++)
{
if(scores[i]<avg)
{
Console.WriteLine(names[i]);
}
}
int[]sortedArray;

sortedArray = scores.OrderByDescending(c => c).ToArray();


Console.WriteLine("The highest test score is " + sortedArray[0]);

Console.WriteLine("NAmes with the highest test score is below ");

for (int i = 0; i < 6; i++)
{
if (scores[i] == sortedArray[0])
{
Console.WriteLine(names[i]);
}
}

Console.ReadLine();

}
}
}

Please rate it if the above solution helps you in any way or if you have any concerns comment it, I will help you through again.

Add a comment
Know the answer?
Add Answer to:
I'm a beginner and have no clue in programming. Please I need help. 2. You are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I need help with this c++ question please thank you ltls. The program should urt valte....

    I need help with this c++ question please thank you ltls. The program should urt valte. 11. Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: void getscore() should ask the user for a test score, store it in a reference param- eter variable, and validate it. This function should be called by main once for each of...

  • Assignment W3-2 This programming assignment addresses: •Compiling and Executing an App with more than 1 class...

    Assignment W3-2 This programming assignment addresses: •Compiling and Executing an App with more than 1 class •Initializing Objects using Constructors •Software Engineering with Private Instances Variables and Public Set/Get Methods •Uses Methods inside classes Description: You are asked to write a program to process two students’ scores. Each student will have scores for 3 tests, the user will input each student’s full name followed by their three scores. When the data for the two students are read from the keyboard,...

  • 2. Create a class that represents a group of students called GroupOfStudents. Create another class Student...

    2. Create a class that represents a group of students called GroupOfStudents. Create another class Student that represents a typical student. The GroupOfStudents class has a list of students as well as the following methods: a. Group average b. Names of all the students whose test scores are below the group average, with an appropriate message c. Highest test score and the names of all the students having the highest score Create a separate test module where instances of the...

  • really need help. All information that i have is posted, In java Dynamic programming allows you...

    really need help. All information that i have is posted, In java Dynamic programming allows you to break a large problem into multiple subproblems. Each of these subproblems must be solved, and the solution must be stored as a memory-based solution. Solve the following binary search algorithm using dynamic programming (Adapted from Esquivalience, 2018): Graph To solve this problem, complete the following tasks: Create a binary search tree using a data structure. Insert the node values as described in the...

  • ANY HELP PLEASE. PLEASE READ THE WHOLE INSTRUCTION THANK YOU Write a program GS.java that will...

    ANY HELP PLEASE. PLEASE READ THE WHOLE INSTRUCTION THANK YOU Write a program GS.java that will be responsible for reading in the names and grades for a group of students, then reporting some statistics about those grades. The statistics to be gathered are the number of scores entered, the highest score and the name(s) of the student(s) who earned that score, the lowest score and the name(s) of the student(s) who earned that score, and the average score for the...

  • c++ Instructions Overview In this programming challenge you will create a program to handle student test...

    c++ Instructions Overview In this programming challenge you will create a program to handle student test scores.  You will have three tasks to complete in this challenge. Instructions Task 1 Write a program that allocates an array large enough to hold 5 student test scores. Once all the scores are entered, the array should be passed to a function that sorts them in ascending order. Another function should be called that calculates the average score. The program should display the...

  • C++ please use only easy code and stdio.h because im just a beginner Description Write the...

    C++ please use only easy code and stdio.h because im just a beginner Description Write the program that can manage the information of students as follows: S 1. This program has two phase; the input phase and the output phase. 2. In an input phase, a teacher inputs the information (name, score, and department) for each student. The total number of students who can be inputted should be defined as a NUM OF_STUDENT constant value. In this example, the value...

  • please help asap in c++, you dont have to do everything but at least give me...

    please help asap in c++, you dont have to do everything but at least give me a starting idea of how this should look like Write a class Assignment that has private attributes for Name, Possible Points and Earned Points Write a class Student that has private attributes for name and a vector of assignments. The constructor method should require a name. Add a method for get total score that returns the total number of points earned divided by the...

  • PROGRAMMING

    Consider the following program that reads students’ test scores into an array and prints the contents of the array.   You will add more functions to the program.  The instructions are given below.For each of the following exercises, write a function and make the appropriate function call in main.Comments are to be added in the program. 1.       Write a void function to find the average test score for each student and store in an array studentAvgs. void AverageScores( const int scores[][MAX_TESTS],                       int...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT