// main.cpp
#include<iostream>
using namespace std;
int main()
{
int quantity = 0;
double cost = 0.0;
double sellPrice = 0.0;
double difference = 0.0;
double profit = 0.0;
cout << "Enter the quantity sold: ";
cin >> quantity;
cout << "Enter the item cost: ";
cin >> cost;
cout << "Enter the selling price: ";
cin >> sellPrice;
difference = (sellPrice - cost);
profit = cost*difference*quantity;
cout << "Profit: $" << profit << endl;
return 0;
}
An Introduction to Programming With C++ (8th Edition) Chapter 9, Exercise 18
C++ Introduction to Programming
It is short and simple practice.
Please solve #1,2,3,4,5
by using
#include <iostream>
#include <string>
#include <vector>
..
using namespace std;
This is the question of the textbook an introduction to programming with C++, 8th edition. 16. In this exercise, you will modify the tip program shown earlier in Figure 7-31. Follow the instructions for starting C++ and viewing the ModifyThis16.cpp file, which is con- tained in either the Cpp8\Chap07\ModifyThis16 Project folder or the Cpp8\Chap07 folder. (You may need to open the project/solution file first.) Change the for statement to a while statement. Save and then run the program. Test the...
What is object oriented programming? please give introduction, explanation and conclusion.
C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! C programming!!C programming!!C programming!!C programming!!C programming!! Q2 (20 marks): remembering state, conditions, functions Write a function that takes two arguments an array and the size of the array and returns a count of all of the numbers between 2 and 5 inclusive. The code below shows how your function will be called. int main(void) { int values[6]={1,2,4,5,3,6}; int size=6; printf("There are %d values between 2 and 5 (inclusive)\n",...
An Introduction to Programming Using Visual Basic Tenth
Edition
Chapter 3 Programming Project 3
What is the solution to this project?
Change X Amount of change: 93 Determine Composition of Change Quarters: 3 Dimes: 1 Nickels: 1 Cents: 3 FIGURE 3.63 Possible outcome of Programming Project 3. own in Fig. 3.62. 3. Change Write a program to make change for an amount of money from 0 through 99 cents input by the user. The output of the program should show...
Write technical report about the socket programming which should include the followng: Introduction about the socket programming Advantages of socket programming Create TCP/IP Client (the source code in any language) socket program that performs the following steps: a. Initializes Winsock. b. Creates a socket. c. Connects to the server. d. Sends and receives data. e. Disconnects. create TCP/IP Server socket program that performs the following steps: a. Initializes Winsock. b. Creates a socket. c. Listen for client. d. Receives and...
An Introduction to Programming Using Visual Basic Tenth
Edition
Chapter 3 Programming Project 2
What is the solution to this project?
one of the numbers in an input text box is change the type of Auto Repair Calculator X Customer: John Doe Hours of labor: 3.5 Cost of parts and supplies 84.55 Display Bill + First number 21 Second number 77 х Customer Labor cost Parts cost Total cost John Doe $122.50 $88.78 $211.28 21 x 77 = 1617 FIGURE...
Introduction To Programming In Java(Second Edition) Exercise 3.1.16 - Given a string that represents a domain name, write a code fragment to determine its top-level domain. For example, the top-level domain of the string cs.princeton.edu is edu. Method is optional.
An Introduction to Programming, Using Python. By David Schneider Chapter 6.2, Problem 10 Using Python, write lines of code to carry out the stated task. Assume that the random module has been imported. Perfect Square Display a perfect square integer between 1 and 10,000 (inclusive) selected at random.