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
- 5.21 In Python: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 is a leap year. Ex: If the input is: 1913 the output is: 1913 is not a leap year. Your program must define and call the following function. The function should return true if the input year is a leap year and false otherwise.def is_leap_year(user_year)7.23 LAB: Winning team (classes) Given main(), define the Team class (in files Team.h and Team.cpp). For class member function GetWinPercentage(), the formula is:teamWins / (teamWins + teamLosses) Note: Use casting to prevent integer division. Ex: If the input is: Ravens 13 3 where Ravens is the team's name, 13 is number of team wins, and 3 is the number of team losses, the output is: Congratulations, Team Ravens has a winning average! If the input is Angels 80 82, the output is: Team Angels has a losing average.Python 3.7.4 Given four files named asiasales2009.txt, europesales2009.txt, africasales2009.txt, and latinamericasales2009.txt, define four file objects named asia, europe, africa, and latin, and use them, respectively, to open the four files for writing.
- Question 40. Consider the following code chunk: import random x=0while(x < 4): x = random.choice([1, 2, 3]) print(x) It is not a good idea to run these lines because...a) x is an invalid argument to print().b) the condition x < 4 is never violated.c) the function random.choice() does not exist. d) x is initialised with the wrong type.Python 3.7.4 Given that add, a function that expects two int parameters and returns their sum, and given that two variables, euro_sales and asia_sales, have already been defined: Write a statement that calls add to compute the sum of euro_sales and asia_sales and that associates this value with a variable named eurasia_sales.task 14.1 in java Follow these steps:● Create a new java file called MyFile.java● Write code to read the content of the text file input.txt. For each line ininput.txt, write a new line in the new text file output.txt that computesthe answer to some operation on a list of numbers.● If the input.txt has the following:Min: 1,2,3,5,6Max: 1,2,3,5,6Avg: 1,2,3,5,6Your program should generate output.txt as follows:The min [1, 2, 3, 5, 6] is 1.The max of [1, 2, 3, 5, 6] is 6.The avg of [1, 2, 3, 5, 6] is 3.4.● Assume that the only operations given in the input file are min, max andavg and that a list of comma-separated integers always follows theoperation. You should define the functions min, max and avg that take ina list of integers and return the min, max or avg of the list.● Your program should handle any combination of operations and anylength of input numbers. You can assume that the list of input numbersare always valid integers and that the list is never empty.● Compile, save and run…
- 5.12.2: Switch statement to convert letters to Greek letters. Write a switch statement that checks origLetter. If 'a' or 'A', print "Alpha". If 'b' or 'B', print "Beta". For any other character, print "Unknown". Use fall-through as appropriate. End with newline. import java.util.Scanner; public class ConvertToGreek {public static void main (String [] args) {Scanner scnr = new Scanner(System.in);char origLetter; origLetter = scnr.next().charAt(0); /* Your solution goes here */ }}12. What is the output of the following program? (2, 3, 6, 8) #include #include #include #include using namespace std; int main() { double x, y; string str; x = 9.0; y = 3.2; cout (sqrt(pow (y, 4))) = " (sqrt(pow (y, 4))) << endl; str = "Predefined functions simplify programming code!"; cout << "Length of str = " << str.length() << endl; return 0; }C++ 13.9.2 Pass by reference Define a function ScaleGrade() that takes two parameters: points: an integer, passed by value, for the student's score. grade: a char, passed by reference, for the student's letter grade. ScaleGrade() changes grade to A if the points are greater than or equal to 88 and less than or equal to 100, and grade is not A. Otherwise, grade is not changed. The function returns true if grade has changed, and returns false otherwise. Ex: If the input is 88 B, then the output is: Grade is A after curving. Using the following code #include <iostream>using namespace std; // insert code here int main() { int studentPoints; char studentGrade; bool isChanged; cin >> studentPoints; cin >> studentGrade; isChanged = ScaleGrade(studentPoints, studentGrade); if (isChanged) { cout << "Grade is " << studentGrade << " after curving." << endl; } else { cout << "Grade " << studentGrade…
- --& 10. Create a function based on the following information: Your mission is to encrypt a secret message (text only, without special chars like "!", "&", "?" etc.) using Caesar cipher where each letter of input text is replaced by another that stands at a fixed distance. For example ("a b c", 3) == "d e f" Input: A secret message as a string (lowercase letters only and white spaces) and number to move text Output: The same string, but encrypted Return: The same string, but encrypted.(7) Implement the ShortenSpace() function. ShortenSpace() has a string parameter and updates the string by replacing all sequences of 2 or more spaces with a single space. ShortenSpace() DOES NOT output the string. Call ShortenSpace() in the PrintMenu() function, and then output the edited string. Ex: Edited text: We'll continue our quest in space. There will be more shuttle flights and more shuttle crews and, yes, more volunteers, more civilians, more teachers in space. Nothing ends here; our hopes and our journeys continue!PLEASE USE JAVA Equivalence Class Software Testing Question: A function foo has k integers as input arguments, i.e., foo(int n1, int n2, …, int nk). Each argument may belong to a different equivalence class, which are stored in an Eq.txt file. In the file, the nth row describes the nth input. Take the second row for example. The data 1, 10; 11, 20; 21, 30 indicates that n2 has three equivalence classes separated by the semi-colons. There is an internal method “int check(int n)” that returns the equivalence class n is in. The result of check(n2 = 3) will be 1 and check(n2 = 25) will be 3. Regarding the function foo, it computes the sum of the returned values by the check function for all input arguments. Follow the Eq.txt file to automatically create test cases for Strong Normal Equivalence class testing. The input argument values are randomly generated. Store your prepared test cases to a test.txt file. Each test case comes with an expected output at the end. All values are delimited…