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
thumb_up100%
Write a program that converts a number entered in Roman numerals to a positive integer. Your program should consist of a class, say, romanType. An object of type romanType should do the following: a. Store the number as a Roman numeral. b. Convert and store the number as a positive integer. c. Print the number as a Roman numeral or positive integer as requested by the
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 4 steps with 3 images
Knowledge Booster
Similar questions
- Suppose there is a class Alarm. Alarm has two calss variables, code which contains a String value representing the code that deactivates the alam, and armed which contains a boolean describing whether or not the alarm is activated. create an alarm object called myAlarm with the code "3579" and print the value of armed to standard outputarrow_forwardWrite a program that converts a number entered in Roman numerals to a positive integer. Your program should consist of a class, say, roman type. An object of type roman type should do the following: a.Store the number as a Roman numeral. b.Convert and store the number as a positive integer. c.Print the number as a Roman numeral or positive integer as requested by the user. The integer values of the Roman numerals are: M 100 D 500 c 100 L 50 x 10 v 5 I 1 d. Test your program using the following Roman numerals: Mcxiv, Ccclix, and Mdclxvi.arrow_forward7. Write a Temperature class that represents temperatures in degrees in both Celsius and Fahrenheit. Use a floating-point number for the temperature and a character for the scale: either 'C' for Celsius or 'F' for Fahrenheit. The class should have · Four constructors: one for the number of de- grees, one for the scale, one for both the de- grees and the scale, and a default construc- tor. For each of these constructors, assume zero degrees if no value is specified and Cel- sius if no scale is given. · Two accessor methods: one to return the temperature in degrees Celsius, the other to return it in degrees Fahrenheit. Use the for- mulas from Practice Program 5 of Chapter 3 and round to the nearest tenth of a degree. • Three set methods: one to set the number of degrees, one to set the scale, and one to set both. • Three comparison methods: one to test whether two temperatures are equal, one to test whether one temperature is greater than another, and one to test whether one temper-…arrow_forward
- Write a class that instantiates a Scanner object and asks the user for their grade, represented by an integer, and then full name, represented by a String, (in that order specifically) on separate lines, and then prints it a string in the format given below with the user input printed. The output should look like below, with bold text in brackets representing user input. Grade: [11] Name: [John Smith] Welcome John Smith, you are in grade 11!arrow_forwardCreate a "tank" class and use it in a program that accepts height and radius from the user and prints total volume in cubic feet, total volume in gallons, and total weight of the water in pounds. Also print the surface area of the top of the tank, the surface area of the outside of the tank, and the total of these two areas in case you need to paint the tank (in square feet). So, the only inputs the class would need is the height and radius of the tank in feet. (python)arrow_forwardBy using Java programming Write a class called ”BankAccount” that has the following variables:• A variable with type String and its name ”acoountHolderName”.• A variable with type int and its name ”accountNum”.• A variable with type double and its name ”balance”.Create the following three methods:• A method called ”Withdraw” of type void takes a parameter of type double called amount. The method takesthe amount of money a customer wants to withdraw from their balance and deducts it from the balance. Themethod must check if there is enough money to withdraw.• A method called ”Deposit” of type void and takes parameter of type double called amount. The method addsthe amount of money to a customer’s balance.• (Bonus) Create a method called ”GenerateAccountNum” to generate a random number with nine digits andassign the variable ”accountNum”The variables and methods names are case-sensitive.arrow_forward
- In python and include doctring: First, write a class named Movie that has four data members: title, genre, director, and year. It should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. The year is an integer and the others are strings. get methods for each of the data members (get_title, get_genre, get_director, and get_year). Next write a class named StreamingService that has two data members: name and catalog. the catalog is a dictionary of Movies, with the titles as the keys and the Movie objects as the corresponding values (you can assume there aren't any Movies with the same title). The StreamingService class should have: an init method that takes the name as an argument, and assigns it to the name data member. The catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get_name and get_catalog). a method named add_movie that takes a Movie…arrow_forwardThis program is for chapter 3’s material. It is creating your own class from scratch.Create a java program that has a code file with main() in it and another code file with a separate class. You will be creating objects of the class in the running program, just as the chapter example creates objects of the Account class. Your system creates a registration bills for the billing part of a college. Create a class called Registration that holds the following information: first name, last name, number of credits, additional fees. The class should have all the gets and sets and also have a method to show the bill (with their name and the total which is 70 per credit + the additional fees) to the student.[Note: Before anyone asks. You cannot have spaces in variable names. So you might call the first one firstName, first_name, fname or any other appropriate and legal variable name. The write up above is telling you the information to be stored in English, not java.]Create 2 objects of…arrow_forwardIn a Java program, create an automobile class that will be used by a dealership as a vehicle inventory program. The following attributes should be present in your automobile class: private string make, private string model, private string color, private int year, private int mileage. Your program should have appropriate methods such as: constructor, add a new vehicle, remove a vehicle, update vehicle attributes. At the end of your program, it should allow the user to output all vehicle inventory to a text file.arrow_forward
- 2. Modify the Fahrenheit program so that it displays a button that when pressed causes theconversion calculation to take place. The user will have the option of pressing Enter inthe text field or pressing the button. Have the listener that is already defined for the textfield also listen for the button push.arrow_forwardPlease use java only. In this assignment, you will implement a simple game in a class called SimpleGame. This game has 2 options for the user playing. Based on user input, the user can choose to either convert time, from seconds to hours, minutes, and seconds, or calculate the sum of all digits in an integer. At the beginning of the game, the user will be prompted to input either 1 or 2, to indicate which option of the game they want to play. 1 will indicate converting time, and 2 will indicate calculating the sum of digits in an integer. For converting time, the user will be prompted to input a number of seconds (as an int) and the program will call a method that will convert the seconds to time, in the format hours:minutes:seconds, and print the result. For example, if the user enters 6734, the program will print the time, 1:52:14. As another example, if the user enters 10,000, the program should print 2:46:39. For calculating the sum of digits in an integer, the user will be…arrow_forwardCreate a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the class—the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it’s declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example, the fraction 12/27 would be stored in the object as 4 in the numerator and 9 in the denominator. Provide public member functions that perform each of the following tasks: a) Adding two Rational numbers. The result should be stored in reduced form. b) Subtracting two Rational numbers. The result should be stored in reduced form. c) Multiplying two Rational numbers. The result should be stored in reduced form. d) Dividing two Rational numbers. The result should be stored in reduced form. e) Printing Rational numbers in the form…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