Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Create a class named BloodData that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and -). Create a default constructor that sets the fields to "O" and "+", and an overloaded constructor that requires values for both fields. Include get and set methods for each field. Save this file as BloodData.java. Create an application named TestBlood Data that demonstrates each method works correctly. Save the application as TestBloodData.java.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
Similar questions
- Create a class called account that might use to represent customers’ bank accounts.Bank account should keep the record of customer’s account balance. Your class shouldprovide a constructor that receives an initial balance and uses it to initialize datamember. Account balance should be greater than or equal to zero. The class shouldprovide the feature credit to insert any amount to customers’ account. Debitfunctionality should enable the user to withdraw the money from account (The functionshould keep the check of the amount withdraw should not exceed the current balance ifit does generate an error message to the user indicating the operation is not possible).Function getBlanceenables the user to check the amount present in his account. solve it in C++.arrow_forwardCarly's Catering provides meals for parties and special events. In Chapter 3, you created an Event class for the company. The Event class contains two public final static fields that hold the price per guest ($35) and the cutoff value for a large event (50 guests), and three private fields that hold an event number, number of guests for the event, and the price. It also contains two public set methods and three public get methods. Now, modify the Event class to contain two overloaded constructors. One constructor accepts an event number and number of guests as parameters. Pass these values to the setEventNumber() and setGuests() methods, respectively. The setGuests() method will automatically calculate the event price. The other constructor is a default constructor that passes "A000" and 0 to the two-parameter constructor. Save the file as Event.java. b. In Chapter 3, you also created an EventDemo class to demonstrate using two Event objects. Now, modify that class to instantiate…arrow_forwardCreate a class called Car. Make this class have a constructor that saves the make and model. Also, make each car have a variable called mileage that defaults to 15. Add a method called drive that adds to the car's mileage. Ignore negative values. Add another method called getStatus that returns the make, model, and mileage of a car. In this problem, submit only the Car.java file. Once you submit, the Demo.java will run to test your code.arrow_forward
- Create a class called GraduateStudent that has the following attributes: GraduateStudent String - FirstName String - LastName String - Major String - Minor Integer - UIN Double - GPA GraduateStudent() GraduateStudent(FirstName, LastName, Major, Minor, UIN, GPA) calculateFinalGrade(Double, Double, Double) - Double getFirstName() - String setFirstName(String) - void getLastName() - String setLastName(String) - void getMajor() - String setMajor(String) - void getMinor() - String setMinor(String) - void getUIN() - Integer setUIN(Integer) - void getGPA() - Double setGPA(Double) - void toString() - String compareTo(GraduateStudent) - Integer equals(GraduateStudent) - Boolean Note: The calculate final grade takes 3 doubles, each of which will be an exam grade out of 100. The first two exams are worth 25% of the final grade, and the third exam is worth 50% of the final grade. You should return this final grade as a double.arrow_forward20arrow_forward2. Create another class named testRoom that uses the above class. This class should have a main() method that behaves as follows: 1. Create two instances of the Pay class: Motel Six that uses the default constructor, and Ramada that creates an instance with $550 as the price of a room. 2. Change the price of the Motel Six room to $265. 3. Change the amenities for the Ramada to $240. 4. Calculate the total cost for both instances. 5. Display the standard room fee, amenities, and total cost for both instances with appropriate labels.arrow_forward
- Create a new Teller Class Build a new Teller class(“Teller.java”). This class will be a sub-class of Employee. The Teller class should have all the same properties as an Employee as well as two new properties: hoursWorked and shift. HoursWorked is the total hours that this teller worked this week, and shift is either “day” or “evening” shift. Make sure to add 2 constructors and a display() method. Do not include a main() method in the Teller class. Test out this Teller class, by building a separate Tester class called TellerTester stored in a new file called ( “TellerTester.java”. This TellerTester class will only have a main() method, that will instantiate a Teller object, pass all the data to the Teller constructor, and lastly call the Teller display() method; just these 3 lines.arrow_forwardAlert dont submit AI generated answer.arrow_forwardPlease help me with this exercise. Thank you!arrow_forward
- Create a class called Employee that includes three instance variables—afirst name (type String), a last name (type String) and a monthly salary (double). Provide aconstructor that initializes the three instance variables. Provide a set and a get method for eachinstance variable. If the monthly salary is not positive, do not set its value. Write a test applicationnamed EmployeeTest that demonstrates class Employee’s capabilities. Create two Employeeobjects and display each object’s yearly salary. Then give each Employee a 10% raise and displayeach Employee’s yearly salary again.arrow_forwardExpert this is warming, don't use any AI platform and don't give plagiarised response to me. If I see plagiarism and AI detection I'll report your account and reduce rating.You have a basic User class for a social media platform. Your task is to enhance the class by introducing a new method called 'post_status.' This method should take a single parameter, which is the status message that the user wants to post. The objective is to implement this method to update the user's status.Next, instantiate a new object of the User class, naming it 'SocialUser.' Utilize the extended class with the newly added 'post_status' method. Your next step is to post three distinct status messages for 'SocialUser'—namely, 'Excited for the weekend!', 'Just finished a great book!', and 'Exploring new hobbies!'To conclude, utilize the 'display_info' method to showcase the updated information about 'SocialUser.' Verify that the output includes details about the newly added status messages, ensuring that they…arrow_forwardClass Circle A Circle will have a radius. The class will be able to keep track of the number of Circle objects created. It will also hold the total of the circumferences of all the Circle objects created. It will allow a client to create a Circle, passing in a double value for the radius into the Circle constructor. If the value for the radius that is passed in is 0 or negative, then the radius will be set to a value of 999. The constructor should add 1 to the count of the number of Circles created. The constructor should call a method to calculate the circumference and then add the circumference for that object to an accumulator. In addition to the constructor, the Circle class must have the following methods that return a boolean value: isCongruent(Circle c) – Compares two Circle objects to determine if they are congruent (radii are equal). isValid() – the radius may not be 0 or negative. equals (Triangle t) – compares two Triangle objects…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY