Demonstrate the class with a driver program

Assignment Help Computer Engineering
Reference no: EM132109211

Programming Project: Course Grades

In a course, a teacher gives the following tests and assignments:

A lab activity that is observed by the teacher and assigned a numeric score.

A pass/fail exam that has 10 questions. The minimum passing score is 70.

An essay that is assigned a numeric score.

A final exam that has 50 questions.

Write a class named CourseGrades that implements the following interface:

public interface Analyzable

{

double getAverage();

GradedActivity getHighest();

GradedActivity getLowest();

}

The class should have a GradedActivity array named grades as a field. The array should have four elements, one for each of the assignments previously described. The class should have the following methods:

setLab: This method should accept a GradedActivity object as its argument. This object should already hold the student's score for the lab activity. Element 0 of the grades field should reference this object.

setPassFailExam: This method should accept a PassFailExam object as its argument. This object should already hold the student's score for the pass/fail exam. Element 1 of the grades field should reference this object.

setEssay: This method should accept an Essay object as its argument. The Essay class extends the GradedActivity class presented in this chapter. The Essay class should determine the grade a student receives for an essay. The student's essay score can be up to 100 and is determined in the following manner: 1) Grammar: 30 points, 2) Spelling: 20 points, 3) Correct length: 20 points, and Content: 30 points. Element 2 of the grades field should reference this object.

setFanalExam: This method should accept a FinalExam object as tis argument. This object should already hold the student's score for the final exam. Element 3 of the grades field should reference this object.

toString: This method should return a string that contains the numeric scores and grades for each element in the grades array.

Demonstrate the class with a driver program.

Sample Output:

Lab Score: 85.0 Grade: B
Pass/Fail Exam Score: 85.0 Grade: P
Essay Score: 80.0 Grade: B
Final Exam Score: 80.0 Grade: B
Average score: 82.5
Highest score: 85.0
Lowest score: 80.0
Press any key to continue . . .

Reference no: EM132109211

Questions Cloud

Write a program that prompts the user to input a sequence : A null-return function, outVowels, that outputs a list of each vowel and the number of times that vowel appeared in the input sequence.
Create a method that determines a score for each : Using the helper class and text files described above, load the 20 movie names and the movie ratings from 30 people into two arrays in memory.
Code a program with functions to search and sort an array : Code a program with functions to search and sort an array, along with a print menu function and a dispatch function.
What is a programming language : Answer the following Question : What is a programming language?
Demonstrate the class with a driver program : In a course, a teacher gives the following tests and assignments: A lab activity that is observed by the teacher and assigned a numeric score.
Write an m-file in matlab which can perform a word search : Convey how the program was developed, what issues were encountered, whether the program was successful (and if not, why not), etc.
Create a patron class for the library : The class will have a user's name. library card number, and library fees (if owed). Have functions that access this data, as well as a function to set the fee.
Print out an error message that contains the first non-digit : This function accepts a C-string parameter (null-terminated char array) and return true if the C-string contains only digits.
Write a public static method named static long tribonacci : Write a public static method named static long tribonacci(int n, long a, long b, long c)

Reviews

Write a Review

Computer Engineering Questions & Answers

  Questionfor each of following schedules state and

questionfor each of following schedules state and illustrate precedence graph whether schedule is serializable or

  Explaining arp command

The arp command: arp -s InetAddr EtherAddr enables you to manually add an entry to ARP cache which resolves the IP address InetAddr to the physical address EtherAddr.

  Create a software assurance guidelines document

Create a software assurance guidelines document shell in Word. Select an existing organization, or identify a hypothetical organization that fits requirements.

  Write a function that converts an input of some integer

Write a function that converts an input of some integer number of nickels into outputs of integer numbers of dollars, quarters, and nickels. Do not write a main function. Your function does not do cin or cout.

  Design a calendar using a skin

Design a calendar using a skin. Create a web page called Calendar.aspx in your Pages folder.

  What is the distribution of y

Let Y be the random variable defined as the time between messages arriving to the computer bulletin board. What is the distribution of Y? What is the mean of Y?

  Make an entity-relationship model representing the data

The manager for the Clearwater Traders wants to gather the following data for each order placed by a customer: customer's name and address, item ordered, quantity of each item, item's size or color if applicable and retail price of each item.

  Question1 while running snort ids why may there be no

question1 while running snort ids why may there be no alerts?2 if we only went to a few web sites why are there so many

  Describe different structures and areas within brain

make sure to discuss the location in the brain, their functions, disorders/pathology related to damage to these structures, and other important information in regards to these structures.

  Write a program to apply combination of transformation

Write a program to apply combination of transformation, rotation, reflection and shearing) on the following objects.

  Define array data type student-scores of length max-length

Define an array data type Student_Scores of length Max_Length. The components are of type Score_Range.

  What types of a packet should be sent in pgp

What types of a packet should be sent in PGP to provide the following security services: Confidentiality, Message integrity, Authentication and Nonrepudiation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd