Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
bartleby

Videos

Textbook Question
Book Icon
Chapter 10, 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
Project 5 - Magic Squares Objectives The objective of this project is to have students practice with two-dimensional arrays and loops. Specifications In this project, you will write code to determine if a two-dimensional array of ints is a Magic Square. For a two- dimensional array of ints to be a Magic Square all of the following must be true: 1. The array must be square - in other words, the lengths of all rows and all columns must be the same. 2. The array must contain all integers from 1 to n*n, where n is the length of the rows and columns. 3. The sum of the numbers in each diagonal, each row, and each column must be the same. You have been given two classes: • MagicSquareTest.java - Contains JUnit test cases for the MagicSquare class. Your code must pass all these tests. • MagicSquare.java - contains static methods to determine if a two-dimensional array of ints is a Magic Square: o isMagicSquare() - returns true if a two-dimensional array of ints meets all the criteria to be a…
Menu Item Description Add Dog 1) Asks the user for all the state value information for a dog. 2) Checks if there is space in the array to hold the new dog. 3) Check that the dogld is not already used in the system. 4) Creates a new Dog object and adds it to the array if there is space. If the array is full, print "Sorry... the Shelter is Full!". Note: All new dogs have no home as yet (foundHome = false). View all dogs This menu option shows all dogs in the system. This includes dogs that have a home and those that do not. View all available dogs Shows all dogs in the system, which have no homes as yet. View a specific dog 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld. 3) Displays the information of the dog associated with that dogld if found. If the dog is not found, "There is no dog with that id.." must be displayed. Update dog home status 1) Asks the user for a dogld. 2) Searches for a dog at the shelter with that dogld 3) If a dog with that id is…
QUESTIONS- 1. Create and array of objects named movies . Each of the objects in the array will represent a movie.Each object should have properties for:movie titlerelease yearrating (your rating 1 - 10)genres (an array of genres. eg ["Drama", "Mystery", "Sci-Fi", "Western"] )The array should contain at least 5 of movies you have seen (choose your own movies)You do not need to use JSON to create this arrayYou can use IMDB if you need help finding the info for your movie2. Now that digital format is taking over, we would like to add a property to each object for the format (“film” or“digital”). The property will be called format . Assuming that all movies in our data set where shot on film, use.forEach() to add the property and set a value of “film” for each movie.3. Use the .map() method to create an array of movie titles from our initial data set named movieTitles .4. Use the .reduce() method to find the highest and lowest rated movies in the data set. Store these objects invariables…

Chapter 10 Solutions

Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)

Ch. 10.4 - When a class member is declared as protected, what...Ch. 10.4 - What is the difference between private members and...Ch. 10.4 - Why should you avoid making class members...Ch. 10.4 - Prob. 10.14CPCh. 10.4 - Why is it easy to give package access to a class...Ch. 10.6 - Look at the following class definition: public...Ch. 10.6 - When you create a class, it automatically has a...Ch. 10.7 - Recall the Rectangle and Cube classes discussed...Ch. 10.8 - Prob. 10.19CPCh. 10.8 - If a subclass extends a superclass with an...Ch. 10.8 - What is the purpose of an abstract class?Ch. 10.8 - If a class is defined as abstract, what can you...Ch. 10.9 - Prob. 10.23CPCh. 10.9 - Prob. 10.24CPCh. 10.9 - Prob. 10.25CPCh. 10.9 - Prob. 10.26CPCh. 10.9 - Prob. 10.27CPCh. 10.9 - Prob. 10.28CPCh. 10 - In an inheritance relationship, this is the...Ch. 10 - In an inheritance relationship, this is the...Ch. 10 - This key word indicates that a class inherits from...Ch. 10 - A subclass does not have access to these...Ch. 10 - This key word refers to an objects superclass. a....Ch. 10 - In a subclass constructor, a call to the...Ch. 10 - The following is an explicit call to the...Ch. 10 - A method in a subclass that has the same signature...Ch. 10 - A method in a subclass having the same name as a...Ch. 10 - These superclass members are accessible to...Ch. 10 - Prob. 11MCCh. 10 - With this type of binding, the Java Virtual...Ch. 10 - This operator can be used to determine whether a...Ch. 10 - When a class implements an interface, it must...Ch. 10 - Prob. 15MCCh. 10 - Prob. 16MCCh. 10 - Abstract classes cannot ___________. a. be used as...Ch. 10 - You use the __________ operator to define an...Ch. 10 - Prob. 19MCCh. 10 - Prob. 20MCCh. 10 - You can use a lambda expression to instantiate an...Ch. 10 - True or False: Constructors are not inherited.Ch. 10 - True or False: in a subclass, a call to the...Ch. 10 - True or False: If a subclass constructor does not...Ch. 10 - True or False: An object of a superclass can...Ch. 10 - True or False: The superclass constructor always...Ch. 10 - True or False: When a method is declared with the...Ch. 10 - True or False: A superclass has a member with...Ch. 10 - True or False: A superclass reference variable can...Ch. 10 - True or False: A subclass reference variable can...Ch. 10 - True or False: When a class contains an abstract...Ch. 10 - True or False: A class may only implement one...Ch. 10 - True or False: By default all members of an...Ch. 10 - // Superclass public class Vehicle { (Member...Ch. 10 - // Superclass public class Vehicle { private...Ch. 10 - // Superclass public class Vehicle { private...Ch. 10 - // Superclass public class Vehicle { public...Ch. 10 - Write the first line of the definition for a...Ch. 10 - Look at the following code, which is the first...Ch. 10 - Write the declaration for class B. The classs...Ch. 10 - Write the statement that calls a superclass...Ch. 10 - A superclass has the following method: public void...Ch. 10 - A superclass has the following abstract method:...Ch. 10 - Prob. 7AWCh. 10 - Prob. 8AWCh. 10 - Look at the following interface: public interface...Ch. 10 - Prob. 1SACh. 10 - A program uses two classes: Animal and Dog. Which...Ch. 10 - What is the superclass and what is the subclass in...Ch. 10 - What is the difference between a protected class...Ch. 10 - Can a subclass ever directly access the private...Ch. 10 - Which constructor is called first, that of the...Ch. 10 - What is the difference between overriding a...Ch. 10 - Prob. 8SACh. 10 - Prob. 9SACh. 10 - Prob. 10SACh. 10 - What is an. abstract class?Ch. 10 - Prob. 12SACh. 10 - When you instantiate an anonymous inner class, the...Ch. 10 - Prob. 14SACh. 10 - Prob. 15SACh. 10 - Employee and ProductionWorker Classes Design a...Ch. 10 - ShiftSupervisor Class In a particular factory, a...Ch. 10 - TeamLeader Class In a particular factory, a team...Ch. 10 - Essay Class Design an Essay class that extends the...Ch. 10 - Course Grades In a course, a teacher gives the...Ch. 10 - Analyzable Interface Modify the CourseGrades class...Ch. 10 - Person and Customer Classes Design a class named...Ch. 10 - PreferredCustomer Class A retail store has a...Ch. 10 - BankAccount and SavingsAccount Classes Design an...Ch. 10 - 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
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
    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
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
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