Define a struct computerType to store the following details about a computer: manufacturer (string), model type (string), processor type (string), ram (int), hard drive size (int), year when the computer was built (int), and the price (double). Write a program that declares a variable of type computerType, prompts the user to input data about a computer, and output the computer’s data. Your program should use the string functions.
Q: C++, create a class called Employee that includes three pieces of information as data members—a…
A: IN C++, create a class called Employee that includes three pieces of information as data members—a…
Q: Using classes and arrays, the team will develop a set of functions for an online shopping system.…
A: Actually, program is an executable software that runs on a computer.
Q: Please implement an constructor of the class CPlusPlus. The constructor has one string as a…
A: The following is the completed C++ program: #include <iostream> using namespace std; class…
Q: Write a student class that will keep track of the grades of students and generates a final mark.…
A: #include<stdio.h> #include<conio.h> void main () { float m1,m2,m3; float per,avg;…
Q: The television seller wants to control the television inventory in his television store through a…
A: I have tried to explain all the steps in the code with various comments.
Q: Create a program in C++ language. Using classes, design an online address book to keep track of the…
A: Using classes, design an online address book to keep track of the names, addresses, phone numbers,…
Q: define a class with two data members , one to store the name of the country and another to store…
A: Given: define a class with two data members, one to store the name of the country and another to…
Q: Create a time class having data members hour, minute and second. Make a constructor to set the…
A: A class is a user-defined data type that combines data members and methods for manipulating that…
Q: Question No. 2 Write a program that takes…
A: Given: Write a program that takes input values as integer, checks the number is not less than 10…
Q: Propose a class structure that can store the following information: • A person's first name • A…
A: A class is a group of objects which have common properties. A constructor is a method that is used…
Q: PROGRAMMING LANGUAGE :C++ QUESTION; You need to store hiring date and date of birth for Managers…
A: Composition in C++- In real life, complex structures are often constructed from smaller, simpler…
Q: write a c++ program with following instructions A Car is composed of four Wheel thingies. If a car…
A: Program is made as per the above instructions. Declared classes with functions Main function is…
Q: Create a class Person with private data members name, age, height and weight. The class must also…
A: #include <iostream> using namespace std; class Person{ private: string name; int age;…
Q: Using classes and arrays, the team will develop a set of functions for an online shopping system.…
A: Actually, program is an executable software that runs on a computer.
Q: 1. The type of computer program that performs a specific personal, educational, and business…
A: The type of computer program that performs a specific personal, educational, and business function…
Q: In C++ Make sure to post unique assignment. Do not copy/paste what has already being posted before.…
A: #include <iostream>using namespace std; class secretType{ private: string name;…
Q: Define the following method inside the Employee 2 class Member Function Description This method is…
A: Given: We are given a problem in which we have a class of employees with some data members. Goal:…
Q: c++ program. Construct a class named Student consisting of an integer student ID number and a…
A: Input : Class Student. Data members : student_ID_number , grade_point. Constructor Accessor…
Q: 2.1 Wheels for Cars Let's first do wheels! 1. You need to define a Wheel class. At the moment, this…
A: Given: Car Information details in C++
Q: Write a C++ Program in which a class name Bank contains Name, account_number and balance as a data…
A: Given: Write a C++ Program in which a class name Bank contains Name, account_number and balance as a…
Q: use C++ programming language. Design and implement a class dayType that implements the day of the…
A: Answer in step2
Q: Given the cost for decoration, Hall expenses, and food. Write a c++ program to check if it is within…
A: Object oriented way has been used to solve the given question
Q: 1) Please write a code using object-oriented programming to solve for the total moment. (You can…
A: We need to read in the dx and dy as input and then compute the total Moment as per the given…
Q: Q2: Write C++ class to represent a baby height and weight chart. In the private part define…
A: Note: Code designed and implemented as mentioned in the question. Code:…
Q: Write a class Distance to measure distance in meters and kilometers. The class should have…
A: // Distance class definition class Distance{ private: int kilometers; int…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: Required: I have the basis of a program that works as an inventory, it reads the contents of a…
Q: Write a program that has variables to store Car data like; CarModel, CarName, CarPrice and CarOwner.…
A: According to the information given:- We have to follow the instruction to write a program that has…
Q: Define a struct computerType to store the following data about a computer: Manufacturer (string),…
A: Given criteria in C language is as follows, File name: “main.c” // Declare the necessary header…
Q: Write a program that demonstrate the use of constructor with default arguments for the following…
A: Define header file <iostream> for input output operations. Define header file <string>…
Q: Q1: Define a class named Person that contains the data fields for the first name and last name.…
A: let us see the answer:- Introduction:- A class is an object's blueprint. A class can be compared to…
Q: Design a class named a Rectangle to represent a rectangle. The class should contain the following:…
A: Solution - Programming language - Java All solution steps are included in program code as comments.…
Q: Write a C++ program to do the following tasks: • Create a Class called Vector with the following…
A: CODE:#include <iostream>#include <cmath> using namespace std; // Vector class…
Q: Using classes, design an online address book to keep track of the names, addresses, phone numbers,…
A: #ifndef H_addressType #define H_addressType#include <iostream>#include <string>using…
Q: In C++ Make sure to post unique assignment. Do not copy/paste what has already being posted before.…
A: Answer: C++ Source Code: #include <iostream>using namespace std; class secretType { private:…
Q: Test The Program The output should look exactly as follows: Food Name: Apples raw
A: Program approach:- Using the header file. Using the standard namespace I/O. Default constructor.…
Q: Create Class Date with variables day,month,year and a function display() and another class Time with…
A: Date Class with variables day, month, year and display function Time Class with variables hour,…
Q: Input data of three countries and display the name of country with greater population
A: Program: // C++ version 14#include<iostream>#include<string.h>using namespace std;//…
Q: Write a C++ program to do the following tasks: Create a Class called Vector with the following…
A: CODE: #include <iostream> #include <cmath> using namespace std; // Vector class…
Q: Suppose in Islamabad International Airport the plans arrivals and departures are frequent and they…
A: Sample Response: //C++ program to computes the kinetic energy#include <iostream>using…
Q: Write C++ program, two object of that type (Sub1 and sub2) with three members (A, B, C) to calculate…
A: You can use an array to store all the values of A, B, C of two objects
Q: Create a class: Doctor, with private data members: id, name, specialization and salary with public…
A: code: #include <iostream>using namespace std;class Doctor{ int id, doc_sal; string…
Q: Using classes and arrays, the team will develop a set of functions for an online shopping system.…
A: Actually, program is an executable software that runs on a computer.
Q: 2- Write C++ program to create class name ration card enter the information, quantity for ration…
A: In this question, we are asked to write a ration card class and fill 7 items with 2 object and print…
Q: Write a C++ program to calculate the area of a rectangle using Class and Constructor. You have to…
A: A class is a group of objects which have common properties. A constructor is a method that is used…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: The ask is to do the following: - Update the program use a Class instead of struct - Add a function…
Q: I have the basis of a program that works as an inventory, it reads the contents of a file and…
A: Required: I have the basis of a program that works as an inventory, it reads the contents of a file…
Q: COSC 1336 – Programming Fundamentals I Program 12 – Classes and Object-Oriented Programming The…
A: Programming Approach: Create a class Employee. Define a constructor. Define a method for setting…
Q: , Write a program that has variables to store Car data like; CarModel, CarName, CarPrice and…
A: Java program without creating the object: import java.util.Scanner; //create Car classpublic class…
Q: Write ONLY Header (No body{}) of function for each question. You can use any valid variable name for…
A: A constructor is a special function that has name same as that of class So the function name here…
Define a struct computerType to store the following details about a computer: manufacturer (string), model type (string), processor type (string), ram (int), hard drive size (int), year when the computer was built (int), and the price (double).
Write a program that declares a variable of type computerType, prompts the user to input data about a computer, and output the computer’s data. Your program should use the string functions.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Define a struct computerType to store the following details about a computer: manufacturer (string), model type (string), processor type (string), ram (int), hard drive size (int), year when the computer was built (int), and the price (double). Write a program that declares a variable of type computerType, prompts the user to input data about a computer, and output the computer’s data. Your program should use the string functions. c++ programCreate a class called Employee that includes four pieces of information as data members — a first name (type string), a middle name (type string) , a last name (type string)and a monthly salary (type int). Your class should have a constructor that initializes the four data members. Provide a set and a get function for each data member. If the monthly salary is not positive, set it to 0. Write a c++ test program that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary.Create a simple C++ program with the 3 following classes. Use separate header and source files for each class. Make all of the class members public. Player name char[32] x, y floats sword - Sword * hit points - int max points - int Player() default constructor Player(char *) - constructor that sets the name heal (Flask *) - heals the player if their health is low and the flask passed in has charges. Do not over heal the player. display() prints the name, sword name and current hit points of the player. Sword name char[32] damage - int attack speed - float Sword() default Sword (char *) set the name Flask name char[32] charges (remaining) int health restored per charge - int Flask() In main create an instance of the Player class and 3 objects from the Sword class. All of these objects must be created on the heap by using the new keyword. Give the swords different names, damage and attack speed values. Equip the player with one of the swords by assigning one of the Sword objects to the…
- Indicate whether each of the following C# programming language identifiers is legal or illegal. If it is legal, indicate whether it is a conventional identifier for a class. electricBill ElectricBill Electric bill Static void #ssn Ay56we Theater_Tickets 212AreaCode heightInCentimeters Zip23891 VoidUsing classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries. Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables. Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType (as designed in this chapters Programming Exercise 2), and the class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables. Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process a maximum of 500 entries. The program should perform the following operations: Load the data into the address book from a disk. Sort the address book by last name. Search for a person by last name. Print the address, phone number, and date of birth (if it exists) of a given person. Print the names of the people whose birthdays are in a given month. Print the names of all the people between two last names. Depending on the users request, print the names of all family members, friends, or business associates.Mark the following statements as true or false. The member variables of a class must be of the same type. (1) The member functions of a class must be public. (2) A class can have more than one constructor. (5) A class can have more than one destructor. (5) Both constructors and destructors can have parameters. (5)
- PLease write the code in C++. Thank you so much. Write A Class Declare a class/struct named NutritionData that contains these private fields foodName (string) servingSize (int) calFromCarb (double) calFromFat (double) calFromProtein (double) Use the data types in parentheses for the fields. Note that you need to use the proper C++ syntax for the fields. Each field should have a comment documenting what it is for. Place one comment above each field. Add the public default constructor. Read the textbook for the syntax of the default constructor. Write the body of the default constructor inline. The default constructor initializes the fields so that the food name is an empty string and all other fields are 0 for int and 0.0 for double. Add public mutator member functions to set the fields. One mutator member function for each field. Each mutator member function's name should begin with the word 'set' followed by the field name with the first letter changed to uppercase. Each member…NEED A PROGRAM CODE IN C++ VISUAL STUDIO WITH NO ERRORS AND OUTPUT Write a class Distance to measure distance in meters and kilometers. The class should have appropriate constructors for initializing members to 0 as well as user provided values. Write another class Time to measure time in hours and minutes. The class should have appropriate constructors for initializing members to 0 as well as user provided values. Overload the < operator for comparing objects of Distance and Time class and display the result to user. Make the data members and functions in your program const where applicable. In addition, write the driver program to compare objects of the Distance and Time class.Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times 885.00 If the student is a parttime…
- Write a program that: Defines an enum named Classification. The enum Classification will have 2 data values: undergraduate, graduate. Defines an enum named Status. The enum Stutus will have 2 data values: parttime, fulltime. Defines an enum named Residency. The enum Residency will have 2 data values: resident, international. Defines a student name variable. Creates a Classification, Status, and Residency, credit hour, cost per credit hour, and tuition variable. Reads the value of the Classification, Status, and Residency, student name and credit hour variable from the user. If the student is a fulltime undergraduate resident student, tuition is credit hour times 345.00 If the student is a fulltime undergraduate international student, tuition is credit hour times 685.00 If the student is a fulltime graduate resident student, tuition is credit hour times 545.00 If the student is a fulltime graduate international student , tuition is credit hour times 885.00 If the student is a parttime…IN C++, create a class called Employee that includes three pieces of information as data members—a first name (type string), a last name (type string) and a monthly salary (type int). Your class should have a constructor that initializes the three data members. Provide a set and a get function for each data member. If the monthly salary is not positive, set it to 0. Write a test program that demonstrates class Employee’s capabilities. Create two Employee objects and display each object’s yearly salary. Then give each Employee a 10 percent raise and display each Employee’s yearly salary again.Write a C++ program to calculate the area of a rectangle using Class and Constructor. You have to declare a class named as Rectangle. Create data member according to the area of rectangle. Create a parameterized constructor to initialize variables according to the area of rectangle. You have to calculate area using function named as AreaOfRectangle. In int main You must create four objects and initialize different data members. For first object take the data member values as 10 and 20. For second object take the data member values as 20 and 30. For third object take the data member values as 30 and 40. For fourth object take the data member values as 40 and 7.50. Find the output of 4 different Areas by access the member function. YOUR OUTPUT SHOULD BE AS FOLLOWS: Area of Rectangle 1: 200 Area of Rectangle 2: 600 Area of Rectangle 3: 1200 Area of Rectangle 4: 2000