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

  Determine the pros and cons of multilevel planning

From the case study, suggest at least three strategies (not discussed in the case study) to successfully conduct multilevel planning. Explain each strategy.

  Program that continuously outputs random numbers

Write down a code in Java that continuously outputs random numbers between 0 and 10000 until a number which is divisible by 5 is encountered.

  Find that exist two elements in s whose sum is exactly x

Since the Computer Science department at Brown believes in doing every- thing through a well defined algorithm, you have to supply these poor guys an algorithm for doing the task, and one that is asymptotically efficient! So, here goes your exact ..

  Prove that greedy approach to fractional knapsack problem

Prove that the greedy approach to the Fractional Knapsack problem yields an optimal solution.

  Draw a red-black representation of the tree

Draw down 2-3-4 tree built when key EASY QUESTION are inserted into an initially empty tree. Draw a red-black representation of the tree from previous question.

  Prepare the project work breakdown structure and resource

you are a small project management consulting company called big-proj that is looking for that big break. you are one

  Calculate surface temperature as a function of cooling-air

Let air at 540°C and 1 atm pressure flow at a velocity of 6 mls normal to a 2.5 cm diameter cylinder. Let the cylinder be of a thin-walled porous material.

  Qestionvoid calc int a intamp bint cc a 2a a 3b c

questionvoid calc int a intamp bint cc a 2a a 3b c awhat is output of following code fragment that invokes calc?

  Identify the independent and dependent variables

Assignment: Explain whether you chose to use an independent-samples t test or a matched-samples t test. Provide a rationale for your choice. Identify the independent and dependent variables

  Which of three application transactions must be made atomic

Which of the three application transactions must be made atomic (e.g., specify transaction boundaries) to prevent possible lost update? Why and why not?

  Write down a concise summary

Write down a concise summary of what you have learned about physical tamper-resistant devices.

  Explain analog signal conditioning

Analog Signal Conditioning, An LVDT with associated signal conditioning will be used to measure work-piece motion from -20 to +20 cm. The static transfer function is 2.5 mV/mm. The output will be interfaced to a computer via an ADC.

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