C++ How to Program (10th Edition)
10th Edition
ISBN: 9780134448237
Author: Paul J. Deitel, Harvey Deitel
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Task-1: Both computer and software engineering programs blend the broad engineering discipline courses with the
computer science specific courses. Hence, it is a good idea to represent the "course" as an object before attempting
to write a program to help students get register to the courses. The programmer can think of the abstraction of a course
object as the representation of title, code, and credit values only.
Write a class declaration for the course object that includes a constructor, a set and a get member function for each
data member, and a member function that returns the course information upon request. For instance, for this course
it should prepare a string like “COMP218 - Object-Oriented Programming".
a) Use C++-strings for the representation of string of characters.
b) Use C-strings for the representation of string of characters.
PROGRAMMING LANGUAGE :C++
QUESTION;
You need to store hiring date and date of birth for Managers and Employees. You need to create a Date class for this purpose. Create objects of Date class in Manager and Employee classes to store respective dates. You need to write print function in Manager and Employee classes as well to print all information of Managers and Employees. You need to perform composition to implement this task. Create objects of Manager and Employee classes in main function and call print function for both objects.
______________________________________________________________
note : print the specific part of code in following ...
Print Date class here:
Print updated Manager class here:
Print updated Employee class here:
Print main function here:
Instructions-Java
Assignment is to define a class named Address.
The Address class will have three private instance variables:
an int named street_number
a String named street_name
and a String named state.
Write three constructors for the Address class:
an empty constructor (no input parameters) that initializes the three instance variables with default values of your choice,
a constructor that takes the street values as input but defaults the state to "Arizona",
and a constructor that takes all three pieces of information as input
Next create a driver class named Main.java. Put public static void main here and test out your class by creating three instances of Address, one using each of the constructors. You can choose the particular address values that are used. I recommend you make them up and do not use actual addresses.
Run your code to make sure it works.
Next add the following public methods to the Address class and test them from main as you go:
Write getters and…
Chapter 11 Solutions
C++ How to Program (10th Edition)
Ch. 11 - Exercises11.3 (Composition as an Alternative to...Ch. 11 - (Inheritance Advantage) Discuss the ways in which...Ch. 11 - (Protected vs. Private Base Classes) Some...Ch. 11 - Prob. 11.6ECh. 11 - Prob. 11.7ECh. 11 - (Quadrilateral Inheritance Hierarchy) Draw an...Ch. 11 - Package Inheritance Hierarchy} Package-delivery...Ch. 11 - (Account Inheritance Hierarchy) Create an...
Knowledge Booster
Similar questions
- programming language :c++ make a program in c++ to store hiring date and date of birth for Managers and Employees. You need to create a Date class for this purpose. Create objects of Date class in Manager and Employee classes to store respective dates. You need to write print function in Manager and Employee classes as well to print all information of Managers and Employees. You need to perform composition to implement this task. Create objects of Manager and Employee classes in main function and call print function for both objects. Print Date class here. Print updated Manager class here. Print updated Employee class here. Print main function here.arrow_forwardObject-Oriented Programming - Java programming.arrow_forwardc++ questionarrow_forward
- Part I Implementation In this part you are asked to Implement C++ classes with their header files. • Define a Shape class which has property such as color, numberOfDors etc. This class should have parameterized constructor. • Define a Vehicle class which has property such as model, price, yearOfPro- duction. This class also have parameterized constructor and related methods • Define a Car class it should extend both of Vehicle and Shape classes at the same time, also have properties such as Horsepower.maxSpeed, fuelType etc. This class also should have parameterized constructors and related methods All class should have separated C++ and header files. Total 6 files. Note all class properties should be private and other are public. Consider the OOP concept. Part II Test Test the "Car" class in a C++ file and print out all information about a car object.arrow_forwardPPM (Portable Pixmap) use three integers to represent a pixel – this means we can have images with RGB colors. You will create a Pixel class in C++ which has three attributes: red: int green: int blue: int You will create a default constructor that initializes those values to 255, and an overloaded constructor that takes user input to assign the values. The class will also have the following functions: changeRGB (): Takes in three integers to update the red, green, and blue attributes. Returns nothing. printRGB (): Takes in nothing. Prints the red, green, and blue attributes in order with a single space in-between each value. Returns nothing. You will then recreate the art program from Assignment 5 with the following changes: Instead of a 2D array of integers, you will create a 2D array of Pixel object. Don’t be scared! This is similar to creating a 2D array of strings. You will prompt for three color values instead of one – red, green, and blue. These must be stored in a Pixel…arrow_forwardReadme.md: Stars(C++) This lab exercise will practice creating objects with constructors and destructors and demonstrate when constructors and destructors are called. Star Class Create a class, Star. A Star object has two member variables: its name, and a solar radius. This class should have a constructor which takes a std::string, the name of the star, and a double, the solar radius of the star. In the constructor, the Star class should print to the terminal that the star was born. For example, if you create a Star as follows: Star my_star("Saiph", 22.2); Then the constructor should print: The star Saiph was born. In the destructor, the Star class should print to the terminal that the star was destroyed, along with the number of times the volume of the sun that that star was, formatted to two decimal places. Hint: use the following line to set the precision to 2 decimal places: std::cout << std::fixed << std::setprecision(2); For example, when my_star above has its…arrow_forward
- Please attach implementation screenshot along with code in c++arrow_forwardCourse: Object Oriented programming Lnaguage: C++ You have to solve the Make the program correctly and in 2 hours. kindly Make program correct as much as you can. Question: Develop a polymorphic banking program using the Account hierarchy in which two types of Accounts can be created i.e.Current Account and Saving Account respectively. Each account must have to give the interest to the bank depending upon their account type. A function of name InterestRate() will calculate the interest of account and returns the interest amount. Current Account has annual interest rate of 0.1% of actual amount and SavingAccount will have to pay interest rate of 1.0% of actual amount. Also write a main function for polymorphic calls of the functions. Note: Polymorphic calls for the functions are necessary. Necessary constructor, Destructors, setters, getters and other functions should also be defined.arrow_forwardC++ Q2: Write a program that defines a (value) as a base class with a set_values () function that give value to integer (val). Then define sub-class square, that calculate the square of the value squar (). In the main, define object of square (sq) and then call the functions in this object.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