Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

dsadadadada

python please

**In-Class Programming 12 (Section 1)**

Create the following program to build a car class (`car_class.py`) and a program (`InClassProgramming12-1.py`) to interact with this class:

### Car class:
- Three private data attributes: `make`, `model`, `year` (initialized with user value when creating object)
- One private data attribute `speed` initialized with zero (0)
- Mutator method for speed named `accelerate`, parameter `accelerateSpeed`, increment speed using parameter value
- Mutator method for speed named `brake`, parameter `brakeSpeed`, decrement speed using parameter value
- Accessor method `get_speed` to return the value of private data attribute speed
- `__str__` method to produce output as shown below

### Program:
- Three user inputs as shown below, store in variables `make`, `model`, and `year`
- Create instance of car object and store in variable `mycar`
- Get user input of acceleration in mph and store in variable `acceleration`
- Loop five times, within loop:
  - Call accelerate mutator of `mycar` and pass `variable acceleration` as argument
  - Display speed by using `get_speed` accessor method of `mycar` (see output below)

- Similar to the previous user input and loop, we need to brake now because we are way too fast
- Get user input of braking speed in mph and store in variable `braking`
- Loop five times, within loop:
  - Call brake mutator of `mycar` and pass variable `braking` as argument
  - Display speed by using `get_speed` accessor method of `mycar` (see output below)
- At the end of your program, call `__str__` method and display its content

### Upload the following files to Canvas:
- Screenshot of the executed code in command line/terminal window (either pasted into a Word document or as an image)
- Text files of your code named `InClassProgramming12-1.py` (put your name and section as comments at the top of file)

### Notes:
- Upload the files (screenshots) and Python code as text file(s)
- Your code should contain some meaningful comments
- Your code should be well organized and formatted

### Screenshot Explanation:
- The screenshot displays a command prompt window running `InClassProgramming12-1.py`.
expand button
Transcribed Image Text:**In-Class Programming 12 (Section 1)** Create the following program to build a car class (`car_class.py`) and a program (`InClassProgramming12-1.py`) to interact with this class: ### Car class: - Three private data attributes: `make`, `model`, `year` (initialized with user value when creating object) - One private data attribute `speed` initialized with zero (0) - Mutator method for speed named `accelerate`, parameter `accelerateSpeed`, increment speed using parameter value - Mutator method for speed named `brake`, parameter `brakeSpeed`, decrement speed using parameter value - Accessor method `get_speed` to return the value of private data attribute speed - `__str__` method to produce output as shown below ### Program: - Three user inputs as shown below, store in variables `make`, `model`, and `year` - Create instance of car object and store in variable `mycar` - Get user input of acceleration in mph and store in variable `acceleration` - Loop five times, within loop: - Call accelerate mutator of `mycar` and pass `variable acceleration` as argument - Display speed by using `get_speed` accessor method of `mycar` (see output below) - Similar to the previous user input and loop, we need to brake now because we are way too fast - Get user input of braking speed in mph and store in variable `braking` - Loop five times, within loop: - Call brake mutator of `mycar` and pass variable `braking` as argument - Display speed by using `get_speed` accessor method of `mycar` (see output below) - At the end of your program, call `__str__` method and display its content ### Upload the following files to Canvas: - Screenshot of the executed code in command line/terminal window (either pasted into a Word document or as an image) - Text files of your code named `InClassProgramming12-1.py` (put your name and section as comments at the top of file) ### Notes: - Upload the files (screenshots) and Python code as text file(s) - Your code should contain some meaningful comments - Your code should be well organized and formatted ### Screenshot Explanation: - The screenshot displays a command prompt window running `InClassProgramming12-1.py`.
Expert Solution
Check Mark
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education