EBK C PROGRAMMING:
8th Edition
ISBN: 9780357156025
Author: Malik
Publisher: Cengage Learning
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 10, Problem 3PE
Write a
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Make use of a statement to initialize a new instance of the Transcript class.
The only locations in our code where we would ever want to add a remark are immediately before a function and immediately preceding a class. if it is true or false:
Instructions
Write a program to illustrate how to use the temporary class, designed in Exercises 13 and 14 of this chapter. Your program must contain statements that would ask the user to enter data of an object and use the setters to initialize the object.
The header file for the class temporary from Exercise 13 has been provided.
An example of the program is shown below:
Enter object name (rectangle, circle, sphere, or cylinder: circle Enter object's dimensions: rectangle (length and width) circle (radius and 0) sphere (radius and 0) rectangle (base raidus and height) 10 0 After setting myObject: circle: radius = 10.00, area = 314.1
I have already tried a code but I can't get it to do one of the steps right. I have added images of what cant be completed with my code now.
Here is my code : Main.cpp
#include "temporary.h"
#include <string>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
string desc;
double first;
double second;…
Chapter 10 Solutions
EBK C PROGRAMMING:
Ch. 10 - Mark the following statements as true or false....Ch. 10 - Find the syntax errors in the following class...Ch. 10 - Find the syntax errors in the following class...Ch. 10 -
Find the syntax errors in the following class...Ch. 10 -
Find the syntax errors in the following class...Ch. 10 - Prob. 6SACh. 10 - Assume the definition of class foodType as given...Ch. 10 -
Consider the definition of the following class:...Ch. 10 - Consider the definition of the class product Type...Ch. 10 -
Consider the definition of the class product Type...
Ch. 10 - Prob. 11SACh. 10 -
Assume the definition of class houseType as given...Ch. 10 - Chapter 9 defined the struct studentType to...Ch. 10 - Write a program that uses the class productType...Ch. 10 -
Write a program that uses the class houseType...Ch. 10 - Prob. 6PECh. 10 - Prob. 7PECh. 10 - Some of the characteristics of a book are the...Ch. 10 - Define the class bankAccount to implement the...
Knowledge Booster
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
- Write a program that uses the class productType defined in Exercises 8 and 10 of this chapter.arrow_forwardInstructions Write a program to illustrate how to use the temporary class, designed in Exercises 13 and 14 of this chapter. Your program must contain statements that would ask the user to enter data of an object and use the setters to initialize the object. The header file for the class temporary from Exercise 13 has been provided. Use 3.1416 as the value of PI. An example of the program is shown below: Enter object name (rectangle, circle, sphere, or cylinder): circle Enter object's dimensions: rectangle (length and width) circle (radius and 0) sphere (radius and 0) cylinder (base radius and height) 10 0 After setting myObject: circle: radius = 10.00, area = 314.16 need main.ccp temporary.h temporarylmpccparrow_forwardInstructor note: This lab is part of the assignment for this chapter. This lab uses two Java files, LabProgram.java and SimpleCar.java. The SimpleCar class has been developed and provided to you already. You don't need to change anything in that class. Your job is to use the SimpleCar class to complete the specified tasks in the main() method of LabProgram.java Given two integers that represent the miles to drive forward and the miles to drive in reverse as user inputs, create a SimpleCar object that performs the following operations: Drives input number of miles forward Drives input number of miles in reverse Honks the horn Reports car status The SimpleCar class is found in the file SimpleCar.java. Ex: If the input is: 100 4 the output is: beep beep Car has driven: 96 milesarrow_forward
- #this is a python programtopic: operation overloading, Encapsulation please find the attached imagearrow_forwardIn this exercise, we are going to revist our Car and ElectricCar class from lesson 3. In lesson 3, you were given the Car class and needed to complete the ElectricCar class. You can use your code from that exercise to get started here. The focus of this exercise is the CarTester class. In this class, you will prompt the user for a car model and if the car is not electric, you will also prompt the user for the miles per gallon. For each car, you will add it to a single ArrayList. You will continue asking the user until they exit, then you will loop through your ArrayList and print the results. Remember, for a method call to compile, it needs to be defined in the reference type (the Car class in this exercise), but the actual method that executes will be based on the instantiated class. In this exercise, we want electric cars to run the Override methods. Sample Output Please enter a car model name(exit to quit): Tesla Is this car electric? (y or n) y Please enter a car model name(exit to…arrow_forwardIn this exercise, we are going to revist our Car and ElectricCar class from lesson 3. In lesson 3, you were given the Car class and needed to complete the ElectricCar class. You can use your code from that exercise to get started here. The focus of this exercise is the CarTester class. In this class, you will prompt the user for a car model and if the car is not electric, you will also prompt the user for the miles per gallon. For each car, you will add it to a single ArrayList. You will continue asking the user until they exit, then you will loop through your ArrayList and print the results. Remember, for a method call to compile, it needs to be defined in the reference type (the Car class in this exercise), but the actual method that executes will be based on the instantiated class. In this exercise, we want electric cars to run the Override methods. Sample Output Please enter a car model name(exit to quit): Tesla Is this car electric? (y or n) y Please enter a car model name(exit to…arrow_forward
- Using the Python language answer the following questions below. Please tell me what program you use if it is IDLE or Atom or a python website please provide the website you use.arrow_forwardCreate a class “Student” with data members such as roll number, name and branch. Create another class “Exam” for storing marks of three subjects. Derive a new class “Result” from “Student” and “Exam” class with data members such as total and average. Display the values of all the data members. Develop a C++ program to model the above relationships. Include comments for the code. Also, can you include screenshots of the code and the output as well Test cases Private – Input 1000 ABC CSE 90 80 70 Output 240 80 Public – Input 2000 DEF IT 25 30 35 Output 90 30arrow_forwardWrite in python and please include docstring. Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It should have an init method that takes four values and uses them to initialize the data members. It should have get methods named get_name, get_ID_number, get_salary, and get_email_address. Write a separate function (not part of the Employee class) named make_employee_dict that takes as parameters a list of names, a list of ID numbers, a list of salaries and a list of email addresses (which are all the same length). The function should take the first value of each list and use them to create an Employee object. It should do the same with the second value of each list, etc. to the end of the lists. As it creates these objects, it should add them to a dictionary, where the key is the ID number and the value for that key is the whole Employee object. The function should return the resulting dictionary. For example, it…arrow_forward
- Pythonarrow_forwardProblem 1 consists of multiple parts. You should finish one part and ensure that it works before moving to the next part. You will need to refactor (rewrite parts of) your code as you move between parts. Only your final program will be graded. Part 1 The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use a SecureRandom object to produce two positive one-digit integers (you will need to look up how to do this). The program should then prompt the user with a question, such as How much is 6 times 7? The student then inputs the answer. Next, the program checks the student’s answer. If it’s correct, display the message "Very good!" and ask another multiplication question. If the answer is wrong, display the message "No. Please try again.>again." and let the student try the same question repeatedly until the student finally gets it right. A separate method should be…arrow_forwardUSING PYTHON 1. Write the PYTHON Programs for the following exercises 2. For each program, you need to write: Comments for all the values, constants, and functions IPO Variables Pseudocode Patient Charges Write a class named Patient that has attributes for the following data: First name, middle name, and last name Address, city, state, and ZIP code Phone number Name and phone number of emergency contact The Patient class’s _ _init_ _ method should accept an argument for each attribute. The Patient class should also have accessor and mutator methods for each attribute. Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have attributes for the following data: Name of the procedure Date of the procedure Name of the practitioner who performed the procedure Charges for the procedure The Procedure class’s _ _init_ _ method should accept an argument for each attribute. The Procedure class should…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Call By Value & Call By Reference in C; Author: Neso Academy;https://www.youtube.com/watch?v=HEiPxjVR8CU;License: Standard YouTube License, CC-BY