Design a program that creates a car object

Assignment Help Other Engineering
Reference no: EM133111651

Question: Design a class as well as a program that creates an object and calls methods

Instructions

Part 1: Design a Class You'll design a class named Car that has the following fields: yearModel-An Integer that holds the car's model year make-A String that holds the make of the car speed-An Integer that holds the car's current speed The class should have the following constructor and other methods: The constructor should accept the car's model year and make as arguments. These values should be assigned to the object's yearModel and make fields. The constructor should also assign 0 to the speed field. Design appropriate accessor methods to get the values stored in an object's yearModel, make, and speed fields.

The accelerate method should add 5 to the speed field each time it's called. The brake method should subtract 5 from the speed field each time it's called. Create your class in a plain-text editor such as Notepad or TextEdit and 2020 Penn Foster Introduction to Programming (v1) : Lesson 4 : Page 22 Inc. save as a text file (*.txt).

Part 2: Design a Program You'll create both pseudocode and a flowchart to design a program that creates a Car object and then calls the accelerate method five times. Review Appendices B and C in your textbook for guidance when working on your project. Use free trials of any of the programs listed in CSC105 Graded Project 1 to create the flowchart. Write your pseudocode in a plain-text editor such as Notepad or TextEdit and save as a text file (*.txt). Also, save a screenshot of your flowchart as a JPEG file (*.jpg). After each call to the accelerate method, get the current speed of the car and display it. Take a screenshot of the results after your fifth time calling the method, and save it as a JPEG file (*.jpg). Then, call the brake method five times. After each call to the brake method, get the current speed of the car and display it. Take a screenshot of the results after your fifth time calling the method, and save it as a JPEG file (*.jpg).

Your project must be submitted as a zipped/compressed file.

Reference no: EM133111651

Questions Cloud

Distribution assumptions of the bsm model : A stock has an expected return (µ) of 17% per annum and a standard deviation (volatility, s) of 37% per annum. Under the probability distribution assumptions of
How many carpets would jerry and ann have : Average costs for gas and maintenance for trucks for each household is $5.50. How many carpets would Jerry and Ann have
Reasons supporting the opposite conclusion : The city of Pawnee's municipal council consists of several departments, one of which is the Parks and Recreation department. Their role is to design and build p
Calculate the time-weighted returns : Given the following cash flow and holding period returns (HPRs), calculate the time-weighted returns (TWR) from the HPRs and the IRR from the cash flow
Design a program that creates a car object : Design a class as well as a program that creates an object and calls methods - design a program that creates a Car object and then calls the accelerate method
What is their ytm : Raines Umbrella Corp. issued 10-year bonds two years ago with a coupon rate of 10 percent. If these bonds currently sell at a price of 115, what is their YTM
Determine share price : Altra Corp will last for 5 years. Its unlevered free cash flow will be $45 million in each of these 5 years. The unlevered cost of capital for the firm is 10%.
How much inventory was requisitioned for use on jobs : The company purchased $305000 of materials; however, it paid for only $242500. How much inventory was requisitioned for use on jobs during 2019
Find the fixed cost per month and variable rate : Tiger asks you to show them the cost formula and also use the high-low method to find the fixed cost per month and variable rate

Reviews

Write a Review

Other Engineering Questions & Answers

  Characterization technology for nanomaterials

Calculate the reciprocal lattice of the body-centred cubic and Show that the reciprocal of the face-centred cubic (fcc) structure is itself a bcc structure.

  Calculate the gasoline savings

How much gasoline do vehicles with the following fuel efficiencies consume in one year? Calculate the gasoline savings, in gallons per year, created by the following two options. Show all your work, and draw boxes around your answers.

  Design and modelling of adsorption chromatography

Design and modelling of adsorption chromatography based on isotherm data

  Application of mechatronics engineering

Write an essay on Application of Mechatronics Engineering

  Growth chracteristics of the organism

To examine the relationship between fermenter design and operating conditions, oxygen transfer capability and microbial growth.

  Block diagram, system performance and responses

Questions based on Block Diagram, System Performance and Responses.

  Explain the difference in a technical performance measure

good understanding of Mil-Std-499 and Mil-Std-499A

  Electrode impedances

How did this procedure affect the signal observed from the electrode and the electrode impedances?

  Write a report on environmental companies

Write a report on environmental companies

  Scanning electron microscopy

Prepare a schematic diagram below of the major parts of the SEM

  Design a pumping and piping system

creating the pumping and piping system to supply cool water to the condenser

  A repulsive potential energy should be a positive one

Using the data provided on the webvista site in the file marked vdw.txt, try to develop a mathematical equation for the vdW potential we discussed in class, U(x), that best fits the data

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd