Write a main() program to test the book and tape class by creating instances of them, asking the user to fill in their data with getdata() and then displaying the data with putdata().
Q: What is the main difference between bytecode and assembly language?
A: Introduction Assembly language, often known as assembler language, symbolic machine code, or just…
Q: Q1 a) Explain the difference between the following :Passing value by reference, Passing value by…
A: (a)#include<iostream> using namespace; void swap(int*x, int y) { int z=*x; *x=*y; *y=z; { int…
Q: Create a base class called shape. Use this class to store two double type values that could be used…
A: program in C++
Q: Write a program that displays the output of Value = value++ + value++; Value = ++value + ++value;…
A: Please find the answer below :
Q: 6.3. An electricity board charges the following rates to domestic users to discourage large…
A: Program Approach: Include necessary header files required create a class electricity and declare…
Q: 5.2 Develop a simple payroll application. There are three kinds of employees in the system: salaried…
A: Here we develop a simple payroll application using C++ #include<iostream>…
Q: 5.3. Write the program, which has two classes one, is Date having members (day, month, year) and the…
A: As it is said that you are a beginner. I am writing a code with beginner level understanding. So, I…
Q: 1. The syntax for operator overloading is Return Type operator symbol (arguments) Explain the…
A: 1. Operator overloading It is possible to change the functioning of some of the operators to…
Q: Create a Class named base which has two data members. Then derive a class derived1 from base class…
A: #include <iostream> using namespace std; //Create a base class class base { public:…
Q: 5.1 Consider the class class base { public: virtual void iam() cout << “base\n"; }; a. Derive two…
A: The program is written in C++ #include <iostream> using namespace std;class base{ public:…
Q: a) Explain pointers to derived class with an example.
A: ⦁ Created two classes, Base class is a parent class and Derived class is derived from the parent.⦁…
Q: .An electricity board charges the following rates to domestic users to discourage large consumption…
A: The main objective of the program is to create a c++ program with two classes called Electricity and…
Q: 4. (Package Inheritance Hierarchy) Package-delivery services, such as FedEx", DHL" and UPS", offer a…
A: Actually, program is a executable software that runs on a computer.
Q: Write a base class Computer that contains data members of wordsize(in bits), memorysize (in…
A: #include <iostream> using namespace std; //Create a base class class Computer { public:…
Q: Print "Hi There I am Programmer" in C++ langauge
A: Please find the answer below :
Q: There are two types of professional wrestlers: "babyfaces" ("good guys") and "heels" ("bad guys").…
A: Actually, the answer has given below:
Q: Write a class Person that has attributes of id, name and address. It has a constructor to…
A: Create Class Create instance variables Create Constructor Create getters and setters for instance…
Q: 5.4. Write a class Teacher that contains the attribute teacher name, age and address. It also…
A: Introduction of Multiple Inheritance: In Multiple Inheritance, one class inherits more than one…
Q: 2. Write a program that declares two classes. The parent class is called Simple that has two data…
A: GIVEN: Create two classes Parent class "Simple" Child class "Complex" Parent class has 2 data…
Q: Create a SavingsAccount class. Use a static data member annualInterestRate to store the annual…
A: #include<iostream>#include<string.h>#include <iomanip>using namespace std;class…
Q: Create a counter class, overload ++ operator for counter post and pre increment, use the object of…
A: The pre-increment operator is applied to increment the value of some variable before functioning it…
Q: Q4: Write a program that performs exception handling. A class should have two exception handling…
A: The class test has a constructor that is used to display and try-catch block for exception handling…
Q: Write a program having a base class Student with data members rollno, name and Class define a member…
A: The code for the given problem is written below in c++ language: Code: #include <iostream>…
Q: . A complex number is a number which can be put in the form a + bi. Create a class for complex…
A: // iostream in C++ is the standard library which implement stream based input/output capabilities…
Q: 6.1. An organization has two types of employees: regular and adhoc. Regular employees get a salary…
A: The required C++ code:…
Q: Q1: Write a program that uses a function template to do a task of your choice. Test the program…
A: Below is the way that we are passing the values and calculting the squares of valueby using function…
Q: Code the example given above with mentioning some message indicating the class construction and…
A: We will print a message whenever the constructor is being called. And will print another message for…
Q: Create an Address class, which contains street#, house#, city and code (all of type char*). Create…
A: Without using concat like functions, you can simply convert the array to string and print it
Q: 5.3. Create a class of Distance including feet and inches. Class should consist minimum required…
A: // iostream in C++ is the standard library which implement stream based input/output capabilities…
Q: Start with the publication, book and tape classes. Add base class sales that holds an array of three…
A: Program: //included header file #include <iostream> #include <string> //inclduded…
Q: 6.1. Read digits as Characters input and convert to equivalent numeral values.
A: #include <iostream> using namespace std; int main() { //Declaring variableslong int…
Q: 6.1. Write a program having a base class Student with data members rollno, name and Class define a…
A: Introduction of the Program: The C++ program has one base class name Student and this class has two…
Step by step
Solved in 3 steps with 1 images
- Create a class Student that contains three members: roll no, name and mark, and threefunctions. Write a first inputStudent() function to get data of student class. Write a secondgetMark() function that returns a student’s mark. Write a third display() function thatdisplays a student’s data. In a main() function, you need to declare 40 students and get dataof all students by using inputStudent() function. And also use a pointer array to keep allstudents by mark greater than 50 and display the searching data of each student in thatpointer array (Use the access operator -> to access a pointer points to member functions ofthe Student class)Exercise 2. Write a driver class to test the Item class as follows: a. Generate 3 Item objects using the all parameters constructor, let the user input all required data. b. Ask the user to input the frequency for each object. c. Print the 3 Items using the display method. Sample Run: Enter code, name, price of Object 1: E001 iPhonell 750 Enter code, name, price of Object 2: FO01 Table 500 Enter code, name, price of Object 3: A001 AirPodPro 230 Enter frequency of object 1: h Enter frequency of object 2: L Enter frequency of object 3: a The price of the item iPhone 11 (E001) is 750, its final price is 600 The price of the item Table (FO01) is 500, its final price is 475 The price of the item Air Pod Pro (A001) is 230, its final price is 230Design and implement a data class. The class will store data that has been read asuser input from the keyboard (see Getting Input below), and provide necessary operations. As the data stored relates to monetary change, the class should be named Change. The class requires at least 2 instance variables for the name of a person and the coin change amount to be given to that person. You may also wish to use 4 instance variables to represent amounts for each of the 4 coin denominations (see Client Class below). There should be no need for more than these instance variables. However, if you wish to use more instance variables, you must provide legitimate justification for their usage in the internal and external documentation. Your class will need to have at least a default constructor, and a constructor with two parameters: one parameter being a name and the other a coin amount. Your class should also provide appropriateget and set methods for client usage. Other methods may be provided as…
- 1. Write a class "Ball" which extends the class disk. It has deltax and deltay attributes. 2. Write the constructor of this class. 3. Write the mothods move(), reverse Deltax(), reverseDeltaY() methods which multiplies the coordinates with -1. 4. Write the getters and the setters of the class.Language - Java Create a utility class called DuplicateCounter. Create an instance method called count that takes a single parameter called dataFile (representing the path to a text file) and uses a Map of Strings to count how many times each word occurs in dataFile. The counts should be stored in an instance variable called wordCounter. Create an instance method called write that takes a single parameter called outputFile (representing the path to a text file) and writes the contents of wordCounter to the file pointed to by outputFile. The output file should be overwritten if it already exists, and created if it does not exist. Create a separate class called Application that contains a main method which illustrates the use of DuplicateCounter by calling both the remove and write methods. Your input file must be called problem2.txt and your output file must be called unique_word_counts.txExercise 1:Design a class Bank that contains a number of bank accounts. Each account has an account number and a current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an array list. Write a readFile method of the Bank class for reading a file with the format accountNumber1, balance1accountNumber2, balance2…Write a readAndPerformTransactions method of the Bank class for reading a file that describes the transactions done by different bank accounts and perform these transactions. For example,1234456742 withdraw 3758686349535 deposit 8501234456742 deposit 150…Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts, print the details of the accounts after performing the transactions, and print the account with the highest balance.
- Exercise 1:Design a class Bank that contains a number of bank accounts. Each account has an account number and a current balance. Add an accountNumber field to the BankAccount class. Store the bank accounts in an array list. Write a readFile method of the Bank class for reading a file with the format accountNumber1, balance1accountNumber2, balance2…Write a readAndPerformTransactions method of the Bank class for reading a file that describes the transactions done by different bank accounts and perform these transactions. For example,1234456742 withdraw 3758686349535 deposit 8501234456742 deposit 150…Implement read methods for the Bank and BankAccount classes. Write a sample program to read in a file with bank accounts, read a file for the transactions and perform these transactions on the concerned accounts, print the details of the accounts after performing the transactions, and print the account with the highest balance.Download the file Insect.cpp(mentioned below) and use this as your start file. Inside the file you will see the implementation of the class Insect. Do the following: a. Write a class BumbleBee that inherits from Insect. Add the public member function void sting() const . This function simply prints "sting!" and a newline. b. Write a class GrassHopper that inherits from Insect. Add the public member function void hop() const . This function simply prints "hop!" and a newline. When you are done your program output should look exactly like the output provided at the end of the file. insect.cpp #include <iostream>using namespace std; // Insect class declarationclass Insect{ protected: int antennae; int legs; int eyes; public: // default constructor Insect(); // getters int getAntennae() const; int getLegs() const; int getEyes() const; }; // BumbleBee class declaration // GrassHopper class…Create three classes Person, Professor and Student. Theclass Person should have data members name and age. Theclasses Professor and Student should inherit from theclass Person.The class Professor should have two integermembers: publications and cur_id. There will be two memberfunctions: getdata and putdata. The function getdata shouldget the input from the user: the name, age and publications ofthe professor. The function putdata should print the name,age, publications and the cur_id of the professor.The class Student should have two data members: marks,which is an array of size 6 and cur_id. It has two memberfunctions: getdata and putdata. The function getdata shouldget the input from the user: the name, age, and the marks ofthe student in 6 subjects. The function putdata should print 1,2,3,4,5,6,7,8,10,11 Students canbe able todevelop theProfessionalDataMaintenanceSystem. the name, age, sum of the marks and the cur_id of the student.For each object being created of the Professor…
- Design the PartnerAssignment class that contains: Two String arrays as attributes. A constructor which takes the text file name as parameter and fill the first array withthe first row of names and the second array with the second row of names in the file. A method checkPartnerAssignment that determines if the assignment of partners iscorrect or incorrect and this method returns a string valueImplement a PowerSeller class that is derived from the Seller class. Create the powerseller.h andpowerseller.cpp files for this class. This derived class contains additional data members include:o the seller’s own web site address (string),o number of items sold in the current year.Methods included in this derived class are:• A default constructor and a copy constructor• A value constructor that receives all data for a power seller• Appropriate get and set functions for the new data• print() – overrides the parent class print() method. This method should call the Sellerclass print method to display all the information from a Person class and the seller class,and also display the additional power seller data with appropriate messages.• read() – overrides the parent class read() method. This method should call the Seller classread method to read all the information for Person class and seller class, and also read inthe information for the specific data for a Power Seller. The addition…P8.2 Implement a class Quiz that implements the Measurable interface. A quiz has a score and a letter grade (such as B+). Use the Data class of Exercise P8.1 to process an array of quizzes. Display the average score and the quiz with the highest score (both letter grade and score).