Starting Out with Java: Early Objects (6th Edition)
Starting Out with Java: Early Objects (6th Edition)
6th Edition
ISBN: 9780134457963
Author: GADDIS
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 9, Problem 5PC

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. 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.
setPassFai1 Exam: 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. (See Programming Challenge 4 for the Essay class. If you have not completed Programming Challenge 4, use a GradedActivity object instead.) This object should already hold the student’s score for the essay. Element 2 of the grades field should reference this object.
setFinal Exam: This method should accept a FinalExam object as its 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 in a program.

Blurred answer
Students have asked these similar questions
please help me with the pseudocode for this I need it.  Student Name Student Id Student Grades (an array of 3 grades) A constructor that clears the student data (use -1 for unset grades) Get functions for items a, b, and c, average, and letter grade Set functions for items a, n, and c Note that the get and set functions for Student grades need an argument for the grade index. Need another class which will contain: An Array of Students (1 above) A count of the number of students in the use You need to create a menu interface that allows you to: Add new students Enter test grades Display all the students with their names, ids, test grades, average, and letter grade Exit the program
(TicTacToe Class) Create a class TicTacToe that will enable you to write a complete programto play the game of tic-tac-toe. The class contains as private data a 3-by-3 two-dimensional arrayof integers. The constructor should initialize the empty board to all zeros. Allow two human players.Wherever the first player moves, place a 1 in the specified square. Place a 2 wherever the second player moves. Each move must be to an empty square. After each move, determine whether the gamehas been won or is a draw. If you feel ambitious, modify your program so that the computer makesthe moves for one of the players. Also, allow the player to specify whether he or she wants to go firstor second. If you feel exceptionally ambitious, develop a program that will play three-dimensionaltic-tac-toe on a 4-by-4-by-4 board. [Caution: This is an extremely challenging project that couldtake many weeks of effort!]
Task #1 Average Class-Create a class called Average according to the UML diagram.  Average: -data [ ] :int -mean: double +Average( ): +calculateMean( ): void +toString( ): String +selectionSort( ): void This class will allow a user to enter 5 scores into an array. It will then rearrange the data in descending order and calculate the mean for the data set. Attributes: -data [ ]— the array which will contain the scores -mean — the arithmetic average of the scores Methods: -Average — the constructor. It will allocate memory for the array. Use a for loop to repeatedly display a prompt for the user which should indicate that user should enter score number 1, score number 2, etc. Note: The computer starts counting with 0, but people start counting with 1, and your prompt should account for this. For example, when the user enters score number 1, it will be stored in indexed variable 0. The constructor will then call the selectionSort and the calculateMean methods.  calculateMean — this is a…

Chapter 9 Solutions

Starting Out with Java: Early Objects (6th Edition)

Ch. 9.4 - When a class member is declared as protected, what...Ch. 9.4 - What is the difference between private members and...Ch. 9.4 - Why should you avoid making class members...Ch. 9.4 - Prob. 9.14CPCh. 9.4 - Why is it easy to give package access to a class...Ch. 9.6 - Look at the following class definition: public...Ch. 9.6 - When you create a class, it automatically has a...Ch. 9.7 - Recall the Rectangle and Cube classes discussed...Ch. 9.8 - Prob. 9.19CPCh. 9.8 - If a subclass extends a superclass with an...Ch. 9.8 - What is the purpose of an abstract class?Ch. 9.8 - If a class is defined as abstract, what can you...Ch. 9.9 - Prob. 9.23CPCh. 9.9 - Prob. 9.24CPCh. 9.9 - Prob. 9.25CPCh. 9.9 - Prob. 9.26CPCh. 9.9 - Prob. 9.27CPCh. 9.9 - Prob. 9.28CPCh. 9 - In an inheritance relationship, this is the...Ch. 9 - In an inheritance relationship, this is the...Ch. 9 - This key word indicates that a class inherits from...Ch. 9 - A subclass does not have access to these...Ch. 9 - This key word refers to an objects superclass. a....Ch. 9 - In a subclass constructor, a call to the...Ch. 9 - The following is an explicit call to the...Ch. 9 - A method in a subclass that has the same signature...Ch. 9 - A method in a subclass having the same name as a...Ch. 9 - These superclass members are accessible to...Ch. 9 - Prob. 11MCCh. 9 - With this type of binding, the Java Virtual...Ch. 9 - Prob. 13MCCh. 9 - Prob. 14MCCh. 9 - Prob. 15MCCh. 9 - Abstract classes cannot ___________. a. be used as...Ch. 9 - You use the __________ operator to define an...Ch. 9 - Prob. 18MCCh. 9 - Prob. 19MCCh. 9 - You can use a lambda expression to instantiate an...Ch. 9 - True or False: Constructors are not inherited.Ch. 9 - True or False: in a subclass, a call to the...Ch. 9 - True or False: If a subclass constructor does not...Ch. 9 - True or False: An object of a superclass can...Ch. 9 - True or False: The superclass constructor always...Ch. 9 - True or False: When a method is declared with the...Ch. 9 - True or False: A superclass has a member with...Ch. 9 - True or False: A superclass reference variable can...Ch. 9 - True or False: A subclass reference variable can...Ch. 9 - True or False: When a class contains an abstract...Ch. 9 - True or False: A class may only implement one...Ch. 9 - True or False: By default all members of an...Ch. 9 - // Superclass public class Vehicle { (Member...Ch. 9 - // Superclass public class Vehicle { private...Ch. 9 - // Superclass public class Vehicle { private...Ch. 9 - // Superclass public class Vehicle { public...Ch. 9 - Write the first line of the definition for a...Ch. 9 - Look at the following code, which is the first...Ch. 9 - Write the declaration for class B. The classs...Ch. 9 - Write the statement that calls a superclass...Ch. 9 - A superclass has the following method: public void...Ch. 9 - A superclass has the following abstract method:...Ch. 9 - Prob. 7AWCh. 9 - Prob. 8AWCh. 9 - Look at the following interface: public interface...Ch. 9 - Prob. 1SACh. 9 - A program uses two classes: Animal and Dog. Which...Ch. 9 - What is the superclass and what is the subclass in...Ch. 9 - What is the difference between a protected class...Ch. 9 - Can a subclass ever directly access the private...Ch. 9 - Which constructor is called first, that of the...Ch. 9 - What is the difference between overriding a...Ch. 9 - Prob. 8SACh. 9 - Prob. 9SACh. 9 - Prob. 10SACh. 9 - What is an. abstract class?Ch. 9 - Prob. 12SACh. 9 - When you instantiate an anonymous inner class, the...Ch. 9 - Prob. 14SACh. 9 - Prob. 15SACh. 9 - Employee and ProductionWorker Classes Design a...Ch. 9 - ShiftSupervisor Class In a particular factory, a...Ch. 9 - TeamLeader Class In a particular factory, a team...Ch. 9 - Essay Class Design an Essay class that extends the...Ch. 9 - Course Grades In a course, a teacher gives the...Ch. 9 - Analyzable Interface Modify the CourseGrades class...Ch. 9 - Person and Customer Classes Design a class named...Ch. 9 - PreferredCustomer Class A retail store has a...Ch. 9 - BankAccount and SavingsAccount Classes Design an...Ch. 9 - Ship, CruiseShip, and CargoShip Classes Design a...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Program to find HCF & LCM of two numbers in C | #6 Coding Bytes; Author: FACE Prep;https://www.youtube.com/watch?v=mZA3cdalYN4;License: Standard YouTube License, CC-BY