HTML Table of Names and Scores
Write a class whose constructor takes a vector of Student objects, where each Student has a name of type string and a score of type int. The class internally stores the data passed to it in its constructor. The class should have an overloaded output operator that outputs its data in the form of an HTML table. Make up suitable input and use it to test your class.
Want to see the full answer?
Check out a sample textbook solutionChapter 11 Solutions
Starting Out With C++: Early Objects (10th Edition)
Additional Engineering Textbook Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Degarmo's Materials And Processes In Manufacturing
Management Information Systems: Managing The Digital Firm (16th Edition)
Concepts Of Programming Languages
Elementary Surveying: An Introduction To Geomatics (15th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
- JAVA -arrow_forwardIn java languagearrow_forwardComputer Science You are required to develop a small chatting application where two or more friends can communicate each other through messages. Create a class Message which has Date d, and message (string). Provide getters/setters, constructors, toString. Create a class Friend having String name, String contact, email and ArrayList of Messages provide getters/setters, constructors, toString addMessage(Message m) method which will add new message to the list. Provide following options to the user using JFrame. Login which will help user login to the application. View Friends (Display List of All Friends) View Messages ( This should display all message of a Friend) Send message (This should ask for friend name and message match the friend name and write that message to the array list).arrow_forward
- Homework Assignment Chapter 10b Create a new Java Project named Chap10b Create a class named Vehicle that acts as a superclass for vehicle types. The Vehicle class contains private data fields for the number of wheels and the average number of miles per gallon. The Vehicle class contains getters and setters for the data fields. The Vehicle class also contains a constructor receiving integer parameters for the number of wheels and average miles per gallons, and a display() method that prints the required output (use get methods). Create two subclasses, Car and MotorCycle, that each extend the Vehicle class. Each subclass contains a constructor that accepts the miles-per-gallon value as an argument and forces the number of wheels to the appropriate value-2 for a MotorCycle and 4 for a Car. Use the superclass constructor to set the wheels and mpg data fields (use the super keyword). Write a UseVehicle class to instantiate one object of each subclass and calls the display method to print…arrow_forwardjavaarrow_forwardBook Donation App Create a book-app directory. The app can be used to manage book donations and track donors and books. The catalog is implemented using the following classes: 1. The app should have donors-repo.js to maintain the list of donors and allow adding, updating, and deleting donors. The donor object has donorID, firstName, lastName, and email properties. This module should implement the following functions: • getDonor(donorId): returns a donor by id. • addDonor(donor): adds a donor to the list of donors; donorID should be autoassigned a random number. • updateDonor(donor): updates the donor having the matching donorID. • deleteDonor(donorID): delete the donor with donorID from the list of donors, only if they are not associated with any books. 2. The app should have books-repo.js to maintain the list of donated books and allow adding, updating, and deleting books. The book object has bookID, title, authors, and donorID properties. • donorID references the book’s donor. This…arrow_forward
- 2. The MyInteger Class Problem Description: Design a class named MyInteger. The class contains: n [] [] A private int data field named value that stores the int value represented by this object. A constructor that creates a MyInteger object for the specified int value. A get method that returns the int value. Methods isEven () and isOdd () that return true if the value is even or odd respectively. Static methods isEven (int) and isOdd (int) that return true if the specified value is even or odd respectively. Static methods isEven (MyInteger) and isOdd (MyInteger) that return true if the specified value is even or odd respectively. Methods equals (int) and equals (MyInteger) that return true if the value in the object is equal to the specified value. Implement the class. Write a client program that tests all methods in the class.arrow_forward1. Dummy GUI Application by Codechum Admin A GUI Application is an application that has a user interface that the user can interact with. For this program, we will be simulating this behavior. First, implement another class called Checkbox which implements the Clickable interface which has only one method: public void click(). The Checkbox will have the following properties: private boolean isChecked (defaults to false upon the creation of object) private String text Additionally, it should have the following methods: the implementation of the click() method If the isChecked is currently false, this will set the isChecked to true and will then print the message "Checkbox is checked". If it is currently true, this will set the isChecked to false and will then print the message "Checkbox is unchecked". Note that the messages to be printed should have also print a new line at the end. an override of the toString() method which returns the message: "Checkbox ({text} - Clicked…arrow_forwardC++ Create a class named Student that has three member variables:name – A string that stores the name of the studentnumClasses – An integer that tracks how many courses the student is currently enrolledinclassList – A dynamic array of strings used to store the names of the classes that thestudent is enrolled inWrite appropriate constructor(s), mutator, and accessor methods for the class along with thefollowing: A method that inputs all values from the user, including the list of class names. Thismethod will have to support input for an arbitrary number of classes. A method that outputs the name and list of all courses. A method that resets the number of classes to 0 and the classList to an empty list. An overloaded assignment operator that correctly makes a new copy of the list ofcourses. A destructor that releases all memory that has been allocated.Write a main method that tests all of your functions.arrow_forward
- class TicTacToePlayer: # Player for a game of Tic Tac Toe def __init__(self, symbol, name): self.symbol = symbol self.name = name def move(self, board): move = int(input(self.name + " make your move 1-9:")) move -= 1 y = move % 3 x = move // 3 board[x][y] = self.symbol def is_symbol(self, symbol): if symbol == self.symbol: return True class TicTacToe: # Game of TicTacToe in a class! def __init__( self, p1_symbol="X", p2_symbol="O", p1_name="Player1", p2_name="Player2" ): self.p1 = TicTacToePlayer(p1_symbol, p1_name) self.p2 = TicTacToePlayer(p2_symbol, p2_name) self.board = [[" " for x in range(3)] for x in range(3)] def play_game(self): turn = 0 winner_symbol = False while not winner_symbol: self._print_board() if turn % 2: self.p2.move(self.board) # replace this line with a call…arrow_forward2. Car Class Write a class named car that has the following fields: ▪ yearModel. The year Model field is an int that holds the car's year model. ▪ make. The make field is a String object that holds the make of the car, such as "Ford", "Chevrolet", "Honda", etc. ▪ speed. The speed field is an int that holds the car's current speed. In addition, the class should have the following methods. ■ Constructor. The constructor should accept the car's year model and make as arguments. These values should be assigned to the object's year Model and make fields. The constructor should also assign 0 to the speed field.arrow_forwardHands-on Activity Blood Bank (Part 1) Objective: At the end of the activity, the student should be able to: Create and overload constructors. Procedure: Develop a simple program that stores a patient's blood Create two (2) classes named BloodData (no class modifier) and RunBloodData (public). For the BloodData class: declare two (2) static String fields named bloodType for accepting (O, A, B, and AB) and rhFactor (stands for Rhesus factor, an inherited protein found on the surface of red blood cells) for accepting + and -. For the default constructor (public) of the BloodData class, set bloodType to "O" and rhFactor to '+'. Create an overloaded constructor (public) with two (2) String parameters: bt and rh. In this constructor, bloodType should store bt while rhFactor should store rh. Create a public method named display. This method will be used to display the values of bloodType and rhFactor. In the RunBloodData class, import the Scanner class for the user input. In the main…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning