C++ #main.cpp #include using namespace std; #include "ItemToPurchase.h" int main() { /* Type your code here */ return 0; } #ItemToPurchase.cpp #include using namespace std; #include "ItemToPurchase.h" /* Type your code here */ #ItemToPurchase.h #ifndef ITEM_TO_PURCHASE_H #define ITEM_TO_PURCHASE_H #include using namespace std; /* Type your code here */ #endif
Q: The following declaration, program, and program segment has errors. Locate as many as you can.…
A:
Q: Private Sub btnDisplay_Click(...) Handles btnDisplay.click Dim acres As Double 'number of acres in a…
A: Given that What is the output displayed when the button is clicked? Private Sub…
Q: The function is named "promptLoyola," and it has the following prototype. // This function will…
A: Please find the code in the next step. I hope you find it helpful. Thanks
Q: C++ Visual 2019 A particular talent competition has five judges, each of whom awards a score…
A: Note: As score can double data type ,so, return type of findLowest() and findHighest() function…
Q: c++ program that asks the user to enter his/her grade in the preliminary examination. Based from…
A: C++ programming language is an object-oriented programming language, that's a cross-platform…
Q: Assignment Description This program will simulate part of the game of Yahtzee! This is a dice…
A: Python code: yahtzee.py:
Q: C-programming. The program is to view a sequence of 30 points of speech data. The display will be…
A: /*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––*//* Homework #9 program…
Q: A BOOKSTORE SELLS BOOKS UNDER THE FOLLOWING CONDITIONS: a. IF THE CLIENT IS TYPE 1, 30% IS…
A: Program: //header file #include <iostream> using namespace std; //main function int main()…
Q: Assume the following declarations: struct EmployeeTag { char name[40]; int ID_number; float salary;…
A: In C programming, a structure allows the programmer to declare and use the user-defined data type.…
Q: Microsoft Visual Studio C++ 2022 Community IDE Task 3: Write a function to calculate the (compound)…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: Microsoft Visual C# debugging exercise 5-2 for chapter 5. This is my code but it gave me an error.…
A: // Hi Buddy, You have done a fabulous job but made a mistake at one point i.e. in while loop, you…
Q: I am using python. How would this code be written? Can someone explain the loop concept?
A: Program: #input for available candy barscandyBar=int(input("Please enter the number of candy bars…
Q: [1). Given the following Structure that represents a Student Struct: ruct Student{ char name[20];…
A: It is defined as a direct descendant of C programming language with additional features such as type…
Q: // Airline.cpp - This program determines if an airline passenger is // eligible for a 25% discount.…
A: Note: I HAVE GIVEN THE SOLUTION AS PER THE OUTPUT GIVEN IN THE QUESTION. Define header file…
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: code def calculate_position(s0,u0,a,t): position = u0*t + 0.5*a*t*t position=position+s0…
Q: Topical Information Use C++. The purpose of this project is to test your ability to use files,…
A: #include <iostream>using namespace std;//number of spaces in stringint cur_word_len (string…
Q: C++ Please explain the code below. It doesn't have to be long, as long as you explain what the…
A: We need to find the function performed by the given code. The given code marges two array into a…
Q: Write a function named Quotient with 2 Integer parameters (originally from text boxes) and a Double…
A: Public Class Form1 Private Function Quotient(x As Single, y As Single) As Double z = x / y End…
Q: PYTHON programming solotion Develop a program that allows the user to enter a start value of 1 to…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: C++ code. Write a program that reads students’ names followed by their test scores. The program…
A: Program: #include <iostream>#include <string>#include <fstream>#include…
Q: A 4th grader is having trouble with Permutation and Combination problem in Mathematics, so a friend…
A: Below i have given program:
Q: C# Programming For every 10 pounds of body weight, the dose of Fixucycline increases by 5 mg.…
A: Solution:
Q: C++ PROGRAM Problem Statement: A 4th grader is having trouble with Permutation and…
A: - We need to highlight the code for the provided scenario of permutations and combinations in C++…
Q: C++ Programming: Instructions The program in Example 5-6 implements the Number Guessing Game.…
A: MODIFIED PROGRAM: //Flag-controlled while loop. //Number guessing game. #include<iostream>…
Q: Q1: Write a C++ class called 'Circle' with private data members: name(string type) and Radius (float…
A: I have given an answer in step 2.
Q: Q5: Complete the function that calculates the position of an object at any time t> 0. The initial…
A: Input : Given the s0,u0, a, and t. Output : Value of position.
Q: C programming language *include comments Inside the main function write code that estimates the…
A: The given problem is related to programming where the code is to be created in C language. The user…
Q: C# Account numbers sometimes contain a check digit that is the result of a mathematical…
A: Account numbers sometimes contain a check digit that is the result of a mathematical calculation.…
Q: 1. Function The Fibonacci sequence is a series of numbers where a number is the addition of the last…
A: class Main { static int calculateSum(int n) { if (n <= 0) return 0;…
Q: Background: Commissions are a form of employee payment where the employee, usually a salesperson,…
A: It is defined as a term which is often used in programming and algorithm based fields. It is a…
Q: You can create multiple instances of any class in C++. TRUE FALSE
A: C++ is an Object oriented programming language. In an Object oriented programming, everything is…
Q: (C PROGRAMMING ONLY) 3. From Person to People by CodeChum Admin Now that we have created a…
A: AS there were no restriction stated hence made this way. Screenshot is also attached (note that to…
Q: C++ programming For this assignment you will write up code for the same number guessing game you…
A: C++ program Code: NumberGuesser.h: class NumberGuesser //define class { private: //private members…
Q: Code in C please: You have returned from a grocery store and you hold a receipt with the products…
A: Program Approach: Including the necessary header files Declaration of structure Defining the main…
Q: Write an application that handles a student report card. The application shall save the marks of…
A: Solution C# PROGRAM using System; //computer science, maths, english //75 congratulationa, else…
Q: WAP in c++ that reads the file FIRST.TXT and creates a new file named SECOND.TXT, to contain only…
A: main.cpp ====================== #include <iostream>#include <fstream>#include…
Q: in C# programming and i need to use using System; using static System.Console; using…
A: Actually, program is an executable software that runs on a computer.
Q: V7 This pseudocode is intended to display // employee net pay values. All employees have a standard…
A: Program plan: Declare the variable name Define the variable EOFNAME as "ZZZZ" Define DEDUCTION as…
Q: C Sharp case Problem 2-1 In Chapter 1, you created two programs to display the motto for the…
A: C# Program is given below - This program takes input from the user. The input is not validated as…
Q: Exercise - Functions and Optionals If an app asks for a user's age, it may be because the app…
A: the code is given below :
Q: + Multiple Conditional Statements EmployeeBonus2.py >- Terminal 1 # EmployeeBonus2.py This program…
A: Find out the mistake from the code.
Q: In C# Define 4 methods with the names of addition, subtraction, multiplication and division. In…
A: Ans:- Code:- using System; public class Calculator { public static void Main() {…
Q: A BOOKSTORE SELLS BOOKS UNDER THE FOLLOWING CONDITIONS: a. IF THE CLIENT IS TYPE 1, 30% IS…
A: Objective: This program reads user data about some book purchases and displays the information after…
Q: Q1: Write a C++ class called 'Circle' with private data members: name(string type) and Radius (float…
A: As per our company guidelines, we are supposed to answer only one question per post and kindly…
Q: Module/Week 7 ASSIGNMENT (ARRAYS)Use functional decomposition to write a C++ program that asks the…
A: This C++ program is used to calculate the user's weight according to the planet. To calculate…
Q: C PROGRAMMING Given code: struct record { char name[10]; int age; }; struct record myfriend =…
A: The C statement is as follows: We access members of strucure by using 2 ways: First way is by using…
Q: C ++ Code Write a program that can be used to calculate the federal tax. The tax is calculated as…
A: Program description: The C++ program will read an input character for single or married, then read…
Q: // Airline.cpp - This program determines if an airline passenger is // eligible for a 25% discount.…
A: Programming instructions: Include necessary header files. Declare all the functions. In the main,…
Q: [In C#] Write an application named SumInts that allows the user to enter any number of integers…
A: Given - I need to write a C# code to take numbers from user until user enters 999 and print the sum…
C++
#main.cpp
#include <iostream>
using namespace std;
#include "ItemToPurchase.h"
int main() {
/* Type your code here */
return 0;
}
#ItemToPurchase.cpp
#include <iostream>
using namespace std;
#include "ItemToPurchase.h"
/* Type your code here */
#ItemToPurchase.h
#ifndef ITEM_TO_PURCHASE_H
#define ITEM_TO_PURCHASE_H
#include <string>
using namespace std;
/* Type your code here */
#endif
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images
- 10.27 LAB: Plant information Given a base Plant class and a derived Flower class, write a program to create a list called my_garden. Store objects that belong to the Plant class or the Flower class in the list. Create a function called print_list(), that uses the print_info() instance methods defined in the respective classes and prints each element in my_garden. The program should read plants or flowers from input (ending with -1), add each Plant or Flower to the my_garden list, and output each element in my_garden using the print_info() function. Note: A list can contain different data type and also different objects. Python for this.8.18 LAB: Warm up: Contacts You will be building a linked list. Make sure to keep track of both the head and tail nodes. (1) Create three files to submit. ContactNode.h - Class declaration ContactNode.cpp - Class definition main.cpp - main() function (2) Build the ContactNode class per the following specifications: Parameterized constructor. Parameters are name followed by phone number. Public member functions InsertAfter() (2 pts) GetName() - Accessor (1 pt) GetPhoneNumber - Accessor (1 pt) GetNext() - Accessor (1 pt) PrintContactNode() Private data members string contactName string contactPhoneNum ContactNode* nextNodePtr Ex. of PrintContactNode() output: Name: Roxanne Hughes Phone number: 443-555-2864 (3) In main(), prompt the user for three contacts and output the user's input. Create three ContactNodes and use the nodes to build a linked list. (2 pts)Ex: Person 1 Enter name: Roxanne Hughes Enter phone number: 443-555-2864 You entered: Roxanne Hughes, 443-555-2864…14.24 LAB: Drop student Complete the Course class by implementing the drop_student() instance method, which removes a student (by last name) from the course roster. If the student is not found in the course roster, no student should be dropped. The file main.py contains: The main function for testing the program. • Class Course represents a course, which contains a list of Student objects as a course roster. (Type your code in here.) Class Student represents a classroom student, which has three attributes: first name, last name, and GPA. (Hint: get_last() returns the last name field.) ● ● Note: For testing purposes, different student values will be used. Ex. For the following students: Henry Nguyen 3.5 Brenda Stern 2.0 Lynda Robison 3.2 Sonya King 3.9 the output for dropping Stern is: Course size: 4 students. Course size after drop: 3 students
- c++ Please Dont use Chegg for this problem 15.7 In-Lab Activity 7: Shapes (I/O operator overloading) In this program, you must implement I/O operator overloading (<< and >>) to match a shape's functionality. You must modify the following files: Triangle.h Implement the declaration for the overloaded I/O operator functions. Triangle.cpp Implement the calculateArea() function to find the area of the triangle. Implement the definitions for the overloaded I/O operator functions. The input function will take in two variables: The base and height (cin >> base >> height) Call the object's calculateArea() function after inputting the variables. The output function will send the following to the output stream (for base = 10 and height = 20): Triangle Object: Base: 10 Height: 20 Area is: 100 Square.h Implement the declaration for the overloaded I/O operator functions. Square.cpp Implement the calculateArea() function to find the area of the square. Implement…10.11 C++ The base class Pet has protected data members petName, and petAge. The derived class Cat extends the Pet class and includes a private data member for catBreed. Complete main() to: create a generic pet and print information using PrintInfo(). create a Cat pet, use PrintInfo() to print information, and add a statement to print the cat's breed using the GetBreed() function. Ex. If the input is: Dobby 2 Kreacher 3 Scottish Fold the output is: Pet Information: Name: Dobby Age: 2 Pet Information: Name: Kreacher Age: 3 Breed: Scottish Fold5.12 Online shopping cart (Java) Create a program using classes that does the following in the zyLabs developer below. For this lab, you will be working with two different class files. To switch files, look for where it says "Current File" at the top of the developer window. Click the current file name, then select the file you need. (1) Create two files to submit: ItemToPurchase.java - Class definition ShoppingCartPrinter.java - Contains main() method Build the ItemToPurchase class with the following specifications: Private fields String itemName - Initialized in default constructor to "none" int itemPrice - Initialized in default constructor to 0 int itemQuantity - Initialized in default constructor to 0 Default constructor Public member methods (mutators & accessors) setName() & getName() (2 pts) setPrice() & getPrice() (2 pts) setQuantity() & getQuantity() (2 pts) (2) In main(), prompt the user for two items and create two objects of the…
- 5.12 Online shopping cart (Java) Create a program using classes that does the following in the zyLabs developer below. For this lab, you will be working with two different class files. To switch files, look for where it says "Current File" at the top of the developer window. Click the current file name, then select the file you need. (1) Create two files to submit: ItemToPurchase.java - Class definition ShoppingCartPrinter.java - Contains main() method Build the ItemToPurchase class with the following specifications: Private fields String itemName - Initialized in default constructor to "none" int itemPrice - Initialized in default constructor to 0 int itemQuantity - Initialized in default constructor to 0 Default constructor Public member methods (mutators & accessors) setName() & getName() (2 pts) setPrice() & getPrice() (2 pts) setQuantity() & getQuantity() (2 pts) (2) In main(), prompt the user for two items and create two objects of the…7.50 LAB: BankAccount class C++ Given main(), define the BankAccount class (in files BankAccount.h and BankAccount.cpp) that manages checking and savings accounts. The class has three private data members: customer name (string) savings account balance (double) checking account balance (double) Implement the following constructor and public member functions as listed below: BankAccount(string newName, double amt1, double amt2) - set the customer name to parameter newName, set the checking account balance to parameter amt1 and set the savings account balance to parameter amt2. (amt stands for amount) void SetName(string newName) - set the customer name to parameter newName string GetName() - return the customer name void SetChecking(double amt) - set the checking account balance to parameter amt double GetChecking() - return the checking account balance void SetSavings(double amt) - set the savings account balance to parameter amt double GetSavings() - return the savings account…2.14 LAB: Pet information (derived classes) The base class Pet has protected fields petName, and petAge. The derived class Dog extends the Pet class and includes a private field for dogBreed. Complete main() to: • create a generic pet and print information using printinfo(). • create a Dog pet, use printInfo() to print information, and add a statement to print the dog's breed using the getBreed() method. Ex. If the input is: Dobby 2 Kreacher 3 German Schnauzer the output is: Pet Information: Name: Dobby Age: 2 Pet Information: Name: Kreacher Age: 3 Breed: German Schnauzer 430560.2938290.qx3zqy7 LAB ACTIVITY File is marked as read only 1 public class Dog extends Pet { 2 private String breed; 3 4 5 6 7 8 9 2.14.1: LAB: Pet information (derived classes) 10 11} } Current file: Dog.java ▾ public void setBreed (String userBreed) { breed userBreed; } public String getBreed() { return breed; 0/10
- 23.2 LAB: Calculator class (Use Python) In the file main.py write a class called Calculator that emulates basic functions of a calculator: add, subtract, multiply, divide, and clear. The class has one attribute called value for the calculator's current value. Implement the following methods as listed below: Default constructor method to set the attribute to 0.0 add(self, val) - add the parameter to the attribute subtract(self, val)- subtract the parameter from the attribute multiply(self, val) - multiply the attribute by the parameter divide(self, val)- divide the attribute by the parameter clear(self) - set the attribute to 0.0 get_value(self) - return the attribute Given two float input values num1 and num2, the program outputs the following values: The initial value of the instance attribute, value The value after adding num1 The value after multiplying by 3 The value after subtracting num2 The value after dividing by 2 The value after calling the clear() method Ex: If…14.20 LAB: Flipping for heads Given main() and GVCoin class, complete function count_heads() in main.py that counts and returns the number of flips taken to achieve a desired number of heads. Function count_heads() has a GVCoin object and an integer representing the desired number of heads as parameters. Note: For testing purposes, a GVCoin object is created in the main() function using a pseudo-random number generator with a fixed seed value. The program uses a seed value of 15 during development, but when submitted, a different seed value will be used for each test case. Ex: If the GVCoin object is created with a seed value of 15 and the desired number of heads is 20, then the function count_heads()) returns 35 and the program outputs: Total number of flips for 20 heads: 357.25 LAB: Artwork label (classes/constructors) Given main(), complete the Artist class (in files Artist.h and Artist.cpp) with constructors to initialize an artist's information, get member functions, and a PrintInfo() member function. The default constructor should initialize the artist's name to "None" and the years of birth and death to 0. PrintInfo() should display Artist Name, born XXXX if the year of death is -1 or Artist Name (XXXX-YYYY) otherwise. Complete the Artwork class (in files Artwork.h and Artwork.cpp) with constructors to initialize an artwork's information, get member functions, and a PrintInfo() member function. The constructor should by default initialize the title to "None", the year created to 0. Declare a private field of type Artist in the Artwork class. Ex. If the input is: Pablo Picasso 1881 1973 Three Musicians 1921 the output is: Artist: Pablo Picasso (1881-1973) Title: Three Musicians, 1921 If the input is: Brice Marden 1938 -1 Distant Muses 2000 the…