Hi, Please find my program.
Please let me know in case of any issue:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
int main(){
// declaring and opening output file
ifstream inFile;
inFile.open("data.in");
// setting precision of double number to 2
cout <<setprecision(2) <<fixed;
// file opening error checking
if(inFile.fail()){
cout<<"Error in opening
file"<<endl;
return -1;
}
int quantity;
double unitprice;
double GST = 36.85;
double grandTotal = GST; // to store total of all
cout<<"Item Number "<<"Unit
Price "<<"Quantity "<<"Item
Total"<<endl;
int count = 1;// counter
// reading all lines
while(inFile>>unitprice>>quantity){
double price =
unitprice*quantity;
grandTotal = grandTotal +
price;
cout<<count<<"\t\t"<<unitprice<<"\t\t"<<quantity<<"\t\t"<<price<<endl;
count++;
}
// closing file
inFile.close();
cout<<"\n\t\t\t\tGST\t"<<GST<<endl;
cout<<"\t\t\t\tGrand
Total\t"<<grandTotal<<endl;
return 0;
}

C++ programming: One line per input/output variable with the exact variable name followed by a description...
In this project you will write a C++ program that simulates the purchase of a single item in an online store. What to do Write a C++ program that: 1. Prints out a welcome message. 2. Prompts the user for the following information: (a) Their first name (example: Roger) (b) Their last name (example: Waters) (c) The name of the product (example: Brick) (d) The unit price of the product (example: 1.99) (e) The quantity to buy (example: 200) (f)...
c/c++
6 The name, ID and section number that appear at the beginning of the output of the program should be your own, not the ones used in the sample 7 Note: results printed must show the data entered at run time, not the data shown in the sample run below! Sample run: My name: Smith, Peter My ID: 300999999 My section: 001 Enter your last name : Smith Enter your first name: Peter 8 9 10 11 12 13...
I need help with this C code Can you explain line by line? Also can you explain to me the flow of the code, like the flow of how the compiler reads it. I need to present this and I want to make sure I understand every single line of it. Thank you! /* * Converts measurements given in one unit to any other unit of the same * category that is listed in the database file, units.txt. * Handles...
c++ programming
no use of classes
use of functions
pseudo code with comments
Requirement: Provide one application for a business store that sale 2 models of one proo model FA218 and model FA318. The application first provides the menu to allow users can select one of the following tasks per time and when they finish one task, they can continue the application to select other task from the menu until they choose exit. All the output on the screen and...
The following is a sample inventory in C++, i want to ask the user to input a item number for removing from inventory. //CPP #include <iostream> #include <fstream> #include <cstdlib> #include <iomanip> #define MAX 1000 using namespace std; //Function to Add a new inventory item to the data into the array in memory void addItem(string desc[],string idNum[], float prices[], int qty[],int &num) { cout<<"Enter the names:"; cin>>desc[num]; cout<<"Enter the item number:"; cin>>idNum[num]; cout<<"Enter the price of item:"; cin>>prices[num]; cout<<"Enter the...
C# Programming:
DebugNine2
The provided file has syntax and/or logical errors. Determine
the problem(s) and fix the program.
+DebugNine2.cs Instructions Build Output The provided file has syntax and/or logical errors. Determine the problem(s) and fix the program. 1/ Creates a Breakfast class 2 // and instantiates an object 3// Displays Breakfast special information 4 using static System.Console; Conpilation fatled: 2 error(s), 8 warnings DebugNine2.cs(9,61): error C$1810: Newline in constant DebugNine2.cs (11,6): error CS1525: Unexpected synbol "Writeltne class DebugNine2 7static void...
Java code
BIRTHDAY GRAPH5 4B Input Standard input Output Standard output Topic Array & Array Processing Birthday Graph Problem Description Everyone loves to be celebrated on their birthdays. Birthday celebration can encourage positive social E interaction among co-workers, foster friendship among classmates or even strengthen bond between E BOBO Birthday graph can be display in many forms. It can a creative drawing consists of cupcakes, balloons, UU candles with names, or it can be in the form of simple bar...
i
need help making this program
the skeleton of the code is below:
//Include the following
#include <iostream>
#include <string>
#include <fstream> //you must include this library if you wish to do file i/o
using namespace std;
/*********************************************************
//Following is the declaration of a order record
**********************************************************/
class order_record
{
public:
string cell_number;
string item_number;
double quantity;
double price;
int processing_plant;
double tax_rate;
double order_tax;
double net_cost;
double total_cost;
};
//Prototypes for your functions: input, output, and process will go...
You are to write a program to produce an inventory report for a local company. Your input will be item name, item number, quantity, price per item, safe stock value. The following shows which columns the input will be in: item name item number quantity price safe stock 20 chars 5 char 3 char 6 chars 3 chars Output will be as follows: item number item name quantity price price*quantity %ofStock flag You will place a symbol in the flag...
Write a program in C++ that simulates a soft drink machine. The program will need several classes: DrinkItem, DrinkMachine and Receipt. For each of the classes you must create the constructors and member functions required below. You can, optionally, add additional private member functions that can be used for doing implementation work within the class. DrinkItem class The DrinkItem class will contains the following private data members: name: Drink name (type of drink – read in from a file). Type...