SlideShare a Scribd company logo
shares.txt(Save the file in the D drive.Then the path of the file pointing to that file is
D:shares.txt )
williams
kane
500
15
18
________________________________________________
C++ code
#include
#include
using namespace std;
int main()
{
//Declaring variables
int noOfShares;
double purPrice,sellPrice;
string firstname,lastname,fname,lname;
double
no_of_shares_sold,purchase_price,selling_price,tot_amt_invested,amount_received_after_sell,se
rvice_tax_during_buy,service_tax_during_sell,total_tax,amount_profit_lost;
//fileInput reference
ifstream dataIn;
//Opening input file
dataIn.open("D:shares.txt");
//Reading the data from the file
while(dataIn>>fname>>lname>>noOfShares>>purPrice>>sellPrice)
{
firstname=fname;
lastname=lname;
no_of_shares_sold=noOfShares;
purchase_price=purPrice;
selling_price=sellPrice;
}
//closing the input stream
dataIn.close();
//calculating total amount invested
tot_amt_invested=no_of_shares_sold*purchase_price;
//Calculating service tax during buying of shares
service_tax_during_buy=tot_amt_invested*0.015;
//calculating the amount received after selling
amount_received_after_sell=no_of_shares_sold*selling_price;
//Calculating service tax after selling of shares
service_tax_during_sell=amount_received_after_sell*0.015;
//calculating Total Service tax paid
total_tax=service_tax_during_buy+service_tax_during_sell;
//calculating amount profit or lost
amount_profit_lost=(amount_received_after_sell-tot_amt_invested)-(total_tax);
//fileoutput reference
ofstream myfile;
//Opening the file
myfile.open ("D:SharesOutput.txt");
//Writing the contents to the file
myfile
<<"No_Of_Shares_sold"<<"||"<<"Purchase_Price"<<"||"<<"Sell_Price"<<"||"<<"Amt_i
nvest";
myfile<<"||"<<"service_charges"<<"||"<<"Amt_Gained"<<"||"<<"Amt_received_After_s
ell ";
myfile<<"t"<
Solution
shares.txt(Save the file in the D drive.Then the path of the file pointing to that file is
D:shares.txt )
williams
kane
500
15
18
________________________________________________
C++ code
#include
#include
using namespace std;
int main()
{
//Declaring variables
int noOfShares;
double purPrice,sellPrice;
string firstname,lastname,fname,lname;
double
no_of_shares_sold,purchase_price,selling_price,tot_amt_invested,amount_received_after_sell,se
rvice_tax_during_buy,service_tax_during_sell,total_tax,amount_profit_lost;
//fileInput reference
ifstream dataIn;
//Opening input file
dataIn.open("D:shares.txt");
//Reading the data from the file
while(dataIn>>fname>>lname>>noOfShares>>purPrice>>sellPrice)
{
firstname=fname;
lastname=lname;
no_of_shares_sold=noOfShares;
purchase_price=purPrice;
selling_price=sellPrice;
}
//closing the input stream
dataIn.close();
//calculating total amount invested
tot_amt_invested=no_of_shares_sold*purchase_price;
//Calculating service tax during buying of shares
service_tax_during_buy=tot_amt_invested*0.015;
//calculating the amount received after selling
amount_received_after_sell=no_of_shares_sold*selling_price;
//Calculating service tax after selling of shares
service_tax_during_sell=amount_received_after_sell*0.015;
//calculating Total Service tax paid
total_tax=service_tax_during_buy+service_tax_during_sell;
//calculating amount profit or lost
amount_profit_lost=(amount_received_after_sell-tot_amt_invested)-(total_tax);
//fileoutput reference
ofstream myfile;
//Opening the file
myfile.open ("D:SharesOutput.txt");
//Writing the contents to the file
myfile
<<"No_Of_Shares_sold"<<"||"<<"Purchase_Price"<<"||"<<"Sell_Price"<<"||"<<"Amt_i
nvest";
myfile<<"||"<<"service_charges"<<"||"<<"Amt_Gained"<<"||"<<"Amt_received_After_s
ell ";
myfile<<"t"<

More Related Content

Similar to shares.txt(Save the file in the D drive.Then the path of the file po.pdf

Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System iChuck Walker
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pcRashila Rr
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
Vijayananda Mohire
 
Log into your netlab workstation then ssh to server.cnt1015.local wi.docx
Log into your netlab workstation then ssh to server.cnt1015.local wi.docxLog into your netlab workstation then ssh to server.cnt1015.local wi.docx
Log into your netlab workstation then ssh to server.cnt1015.local wi.docx
desteinbrook
 
Unix-module3.pptx
Unix-module3.pptxUnix-module3.pptx
Unix-module3.pptx
ssuser8594b8
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
Shyam Gupta
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
Melissa Moore
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handlingpinkpreet_kaur
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handlingpinkpreet_kaur
 
Here is my code. There are Two C Programs which need to follow the a.pdf
Here is my code. There are Two C Programs which need to follow the a.pdfHere is my code. There are Two C Programs which need to follow the a.pdf
Here is my code. There are Two C Programs which need to follow the a.pdf
fcaindore
 
Question 1 has already been posted to Chegg and I am waiting for the.pdf
Question 1 has already been posted to Chegg and I am waiting for the.pdfQuestion 1 has already been posted to Chegg and I am waiting for the.pdf
Question 1 has already been posted to Chegg and I am waiting for the.pdf
anjandavid
 
Chapter 3
Chapter 3Chapter 3
Chapter 3lopjuan
 
File in cpp 2016
File in cpp 2016 File in cpp 2016
File in cpp 2016
Dr .Ahmed Tawwab
 
Data Structure Using C - FILES
Data Structure Using C - FILESData Structure Using C - FILES
Data Structure Using C - FILES
Harish Kamat
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
yuvrajkeshri
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
lakshmanarao027MVGRC
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
lakshmanarao027MVGRC
 
C++ help!! Im not familiar with how to save- read file so that the pro.docx
C++ help!! Im not familiar with how to save- read file so that the pro.docxC++ help!! Im not familiar with how to save- read file so that the pro.docx
C++ help!! Im not familiar with how to save- read file so that the pro.docx
marions12
 
17 files and streams
17 files and streams17 files and streams
17 files and streams
Docent Education
 

Similar to shares.txt(Save the file in the D drive.Then the path of the file po.pdf (20)

Working with the IFS on System i
Working with the IFS on System iWorking with the IFS on System i
Working with the IFS on System i
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
Log into your netlab workstation then ssh to server.cnt1015.local wi.docx
Log into your netlab workstation then ssh to server.cnt1015.local wi.docxLog into your netlab workstation then ssh to server.cnt1015.local wi.docx
Log into your netlab workstation then ssh to server.cnt1015.local wi.docx
 
Unix-module3.pptx
Unix-module3.pptxUnix-module3.pptx
Unix-module3.pptx
 
Stream classes in C++
Stream classes in C++Stream classes in C++
Stream classes in C++
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Basics of file handling
Basics of file handlingBasics of file handling
Basics of file handling
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handling
 
Here is my code. There are Two C Programs which need to follow the a.pdf
Here is my code. There are Two C Programs which need to follow the a.pdfHere is my code. There are Two C Programs which need to follow the a.pdf
Here is my code. There are Two C Programs which need to follow the a.pdf
 
Question 1 has already been posted to Chegg and I am waiting for the.pdf
Question 1 has already been posted to Chegg and I am waiting for the.pdfQuestion 1 has already been posted to Chegg and I am waiting for the.pdf
Question 1 has already been posted to Chegg and I am waiting for the.pdf
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
File in cpp 2016
File in cpp 2016 File in cpp 2016
File in cpp 2016
 
Data Structure Using C - FILES
Data Structure Using C - FILESData Structure Using C - FILES
Data Structure Using C - FILES
 
file_handling_in_c.ppt
file_handling_in_c.pptfile_handling_in_c.ppt
file_handling_in_c.ppt
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
 
File_Handling in C.ppt
File_Handling in C.pptFile_Handling in C.ppt
File_Handling in C.ppt
 
C++ help!! Im not familiar with how to save- read file so that the pro.docx
C++ help!! Im not familiar with how to save- read file so that the pro.docxC++ help!! Im not familiar with how to save- read file so that the pro.docx
C++ help!! Im not familiar with how to save- read file so that the pro.docx
 
Structure
StructureStructure
Structure
 
17 files and streams
17 files and streams17 files and streams
17 files and streams
 

More from appsmobileshoppe

what is PSolutionwhat is P.pdf
what is PSolutionwhat is P.pdfwhat is PSolutionwhat is P.pdf
what is PSolutionwhat is P.pdf
appsmobileshoppe
 
Moles = 0.142138 = 0.00102 moles .pdf
                     Moles = 0.142138 = 0.00102 moles                .pdf                     Moles = 0.142138 = 0.00102 moles                .pdf
Moles = 0.142138 = 0.00102 moles .pdf
appsmobileshoppe
 
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdfThe name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
appsmobileshoppe
 
The main thing we have to do is correct tap on the system status not.pdf
The main thing we have to do is correct tap on the system status not.pdfThe main thing we have to do is correct tap on the system status not.pdf
The main thing we have to do is correct tap on the system status not.pdf
appsmobileshoppe
 
The answer is b. H2SBoth S and O come from the same group of the .pdf
The answer is b. H2SBoth S and O come from the same group of the .pdfThe answer is b. H2SBoth S and O come from the same group of the .pdf
The answer is b. H2SBoth S and O come from the same group of the .pdf
appsmobileshoppe
 
Molarity , M = ( massMolar mass) Volume of sol.pdf
                     Molarity , M = ( massMolar mass)  Volume of sol.pdf                     Molarity , M = ( massMolar mass)  Volume of sol.pdf
Molarity , M = ( massMolar mass) Volume of sol.pdf
appsmobileshoppe
 
Many molecules contain bonds that fall between th.pdf
                     Many molecules contain bonds that fall between th.pdf                     Many molecules contain bonds that fall between th.pdf
Many molecules contain bonds that fall between th.pdf
appsmobileshoppe
 
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdfthe 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
appsmobileshoppe
 
molality = moles of solute mass of solvent = 4..pdf
                     molality = moles of solute  mass of solvent = 4..pdf                     molality = moles of solute  mass of solvent = 4..pdf
molality = moles of solute mass of solvent = 4..pdf
appsmobileshoppe
 
SolutionTrueIn a shared block prevents need another user from p.pdf
SolutionTrueIn a shared block prevents need another user from p.pdfSolutionTrueIn a shared block prevents need another user from p.pdf
SolutionTrueIn a shared block prevents need another user from p.pdf
appsmobileshoppe
 
Scientific approaches have been defined to depict the methods to stu.pdf
Scientific approaches have been defined to depict the methods to stu.pdfScientific approaches have been defined to depict the methods to stu.pdf
Scientific approaches have been defined to depict the methods to stu.pdf
appsmobileshoppe
 
Ques-1Government funding is limited so that the factors are neede.pdf
Ques-1Government funding is limited so that the factors are neede.pdfQues-1Government funding is limited so that the factors are neede.pdf
Ques-1Government funding is limited so that the factors are neede.pdf
appsmobileshoppe
 
Please follow the data and description Impact of absorption on tr.pdf
Please follow the data and description Impact of absorption on tr.pdfPlease follow the data and description Impact of absorption on tr.pdf
Please follow the data and description Impact of absorption on tr.pdf
appsmobileshoppe
 
Part-aLactose is a disaccharide and composed of glucose and galac.pdf
Part-aLactose is a disaccharide and composed of glucose and galac.pdfPart-aLactose is a disaccharide and composed of glucose and galac.pdf
Part-aLactose is a disaccharide and composed of glucose and galac.pdf
appsmobileshoppe
 
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdfln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
appsmobileshoppe
 
In the first, the NO2 attaches at the 3 position .pdf
                     In the first, the NO2 attaches at the 3 position .pdf                     In the first, the NO2 attaches at the 3 position .pdf
In the first, the NO2 attaches at the 3 position .pdf
appsmobileshoppe
 
hydride ion reacts with water to give hydrogen an.pdf
                     hydride ion reacts with water to give hydrogen an.pdf                     hydride ion reacts with water to give hydrogen an.pdf
hydride ion reacts with water to give hydrogen an.pdf
appsmobileshoppe
 
Labels on the right side of image (when we look at it)1. medial le.pdf
Labels on the right side of image (when we look at it)1. medial le.pdfLabels on the right side of image (when we look at it)1. medial le.pdf
Labels on the right side of image (when we look at it)1. medial le.pdf
appsmobileshoppe
 
joint distribution function of X and Y will be given by int-( i.pdf
joint distribution function of X and Y will be given by int-( i.pdfjoint distribution function of X and Y will be given by int-( i.pdf
joint distribution function of X and Y will be given by int-( i.pdf
appsmobileshoppe
 
he had not removed and washed with distilled wate.pdf
                     he had not removed and washed with distilled wate.pdf                     he had not removed and washed with distilled wate.pdf
he had not removed and washed with distilled wate.pdf
appsmobileshoppe
 

More from appsmobileshoppe (20)

what is PSolutionwhat is P.pdf
what is PSolutionwhat is P.pdfwhat is PSolutionwhat is P.pdf
what is PSolutionwhat is P.pdf
 
Moles = 0.142138 = 0.00102 moles .pdf
                     Moles = 0.142138 = 0.00102 moles                .pdf                     Moles = 0.142138 = 0.00102 moles                .pdf
Moles = 0.142138 = 0.00102 moles .pdf
 
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdfThe name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
The name of As2S5 is diarsenic pentasulfide.TRUEExplanationAs .pdf
 
The main thing we have to do is correct tap on the system status not.pdf
The main thing we have to do is correct tap on the system status not.pdfThe main thing we have to do is correct tap on the system status not.pdf
The main thing we have to do is correct tap on the system status not.pdf
 
The answer is b. H2SBoth S and O come from the same group of the .pdf
The answer is b. H2SBoth S and O come from the same group of the .pdfThe answer is b. H2SBoth S and O come from the same group of the .pdf
The answer is b. H2SBoth S and O come from the same group of the .pdf
 
Molarity , M = ( massMolar mass) Volume of sol.pdf
                     Molarity , M = ( massMolar mass)  Volume of sol.pdf                     Molarity , M = ( massMolar mass)  Volume of sol.pdf
Molarity , M = ( massMolar mass) Volume of sol.pdf
 
Many molecules contain bonds that fall between th.pdf
                     Many molecules contain bonds that fall between th.pdf                     Many molecules contain bonds that fall between th.pdf
Many molecules contain bonds that fall between th.pdf
 
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdfthe 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
the 4 examples are1) HI HI = H+ + I-2) HBr HBr = H+ + Br-.pdf
 
molality = moles of solute mass of solvent = 4..pdf
                     molality = moles of solute  mass of solvent = 4..pdf                     molality = moles of solute  mass of solvent = 4..pdf
molality = moles of solute mass of solvent = 4..pdf
 
SolutionTrueIn a shared block prevents need another user from p.pdf
SolutionTrueIn a shared block prevents need another user from p.pdfSolutionTrueIn a shared block prevents need another user from p.pdf
SolutionTrueIn a shared block prevents need another user from p.pdf
 
Scientific approaches have been defined to depict the methods to stu.pdf
Scientific approaches have been defined to depict the methods to stu.pdfScientific approaches have been defined to depict the methods to stu.pdf
Scientific approaches have been defined to depict the methods to stu.pdf
 
Ques-1Government funding is limited so that the factors are neede.pdf
Ques-1Government funding is limited so that the factors are neede.pdfQues-1Government funding is limited so that the factors are neede.pdf
Ques-1Government funding is limited so that the factors are neede.pdf
 
Please follow the data and description Impact of absorption on tr.pdf
Please follow the data and description Impact of absorption on tr.pdfPlease follow the data and description Impact of absorption on tr.pdf
Please follow the data and description Impact of absorption on tr.pdf
 
Part-aLactose is a disaccharide and composed of glucose and galac.pdf
Part-aLactose is a disaccharide and composed of glucose and galac.pdfPart-aLactose is a disaccharide and composed of glucose and galac.pdf
Part-aLactose is a disaccharide and composed of glucose and galac.pdf
 
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdfln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
ln(lnx)=4if ln a = c , then a = ec== lnx = e4== x = ee^4.pdf
 
In the first, the NO2 attaches at the 3 position .pdf
                     In the first, the NO2 attaches at the 3 position .pdf                     In the first, the NO2 attaches at the 3 position .pdf
In the first, the NO2 attaches at the 3 position .pdf
 
hydride ion reacts with water to give hydrogen an.pdf
                     hydride ion reacts with water to give hydrogen an.pdf                     hydride ion reacts with water to give hydrogen an.pdf
hydride ion reacts with water to give hydrogen an.pdf
 
Labels on the right side of image (when we look at it)1. medial le.pdf
Labels on the right side of image (when we look at it)1. medial le.pdfLabels on the right side of image (when we look at it)1. medial le.pdf
Labels on the right side of image (when we look at it)1. medial le.pdf
 
joint distribution function of X and Y will be given by int-( i.pdf
joint distribution function of X and Y will be given by int-( i.pdfjoint distribution function of X and Y will be given by int-( i.pdf
joint distribution function of X and Y will be given by int-( i.pdf
 
he had not removed and washed with distilled wate.pdf
                     he had not removed and washed with distilled wate.pdf                     he had not removed and washed with distilled wate.pdf
he had not removed and washed with distilled wate.pdf
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 

shares.txt(Save the file in the D drive.Then the path of the file po.pdf

  • 1. shares.txt(Save the file in the D drive.Then the path of the file pointing to that file is D:shares.txt ) williams kane 500 15 18 ________________________________________________ C++ code #include #include using namespace std; int main() { //Declaring variables int noOfShares; double purPrice,sellPrice; string firstname,lastname,fname,lname; double no_of_shares_sold,purchase_price,selling_price,tot_amt_invested,amount_received_after_sell,se rvice_tax_during_buy,service_tax_during_sell,total_tax,amount_profit_lost; //fileInput reference ifstream dataIn; //Opening input file dataIn.open("D:shares.txt"); //Reading the data from the file while(dataIn>>fname>>lname>>noOfShares>>purPrice>>sellPrice) { firstname=fname; lastname=lname; no_of_shares_sold=noOfShares; purchase_price=purPrice;
  • 2. selling_price=sellPrice; } //closing the input stream dataIn.close(); //calculating total amount invested tot_amt_invested=no_of_shares_sold*purchase_price; //Calculating service tax during buying of shares service_tax_during_buy=tot_amt_invested*0.015; //calculating the amount received after selling amount_received_after_sell=no_of_shares_sold*selling_price; //Calculating service tax after selling of shares service_tax_during_sell=amount_received_after_sell*0.015; //calculating Total Service tax paid total_tax=service_tax_during_buy+service_tax_during_sell; //calculating amount profit or lost amount_profit_lost=(amount_received_after_sell-tot_amt_invested)-(total_tax); //fileoutput reference ofstream myfile; //Opening the file myfile.open ("D:SharesOutput.txt"); //Writing the contents to the file myfile <<"No_Of_Shares_sold"<<"||"<<"Purchase_Price"<<"||"<<"Sell_Price"<<"||"<<"Amt_i nvest"; myfile<<"||"<<"service_charges"<<"||"<<"Amt_Gained"<<"||"<<"Amt_received_After_s ell ";
  • 3. myfile<<"t"< Solution shares.txt(Save the file in the D drive.Then the path of the file pointing to that file is D:shares.txt ) williams kane 500 15 18 ________________________________________________ C++ code #include #include using namespace std; int main() { //Declaring variables int noOfShares; double purPrice,sellPrice; string firstname,lastname,fname,lname; double no_of_shares_sold,purchase_price,selling_price,tot_amt_invested,amount_received_after_sell,se rvice_tax_during_buy,service_tax_during_sell,total_tax,amount_profit_lost; //fileInput reference ifstream dataIn; //Opening input file dataIn.open("D:shares.txt"); //Reading the data from the file while(dataIn>>fname>>lname>>noOfShares>>purPrice>>sellPrice) { firstname=fname; lastname=lname;
  • 4. no_of_shares_sold=noOfShares; purchase_price=purPrice; selling_price=sellPrice; } //closing the input stream dataIn.close(); //calculating total amount invested tot_amt_invested=no_of_shares_sold*purchase_price; //Calculating service tax during buying of shares service_tax_during_buy=tot_amt_invested*0.015; //calculating the amount received after selling amount_received_after_sell=no_of_shares_sold*selling_price; //Calculating service tax after selling of shares service_tax_during_sell=amount_received_after_sell*0.015; //calculating Total Service tax paid total_tax=service_tax_during_buy+service_tax_during_sell; //calculating amount profit or lost amount_profit_lost=(amount_received_after_sell-tot_amt_invested)-(total_tax); //fileoutput reference ofstream myfile; //Opening the file myfile.open ("D:SharesOutput.txt"); //Writing the contents to the file myfile <<"No_Of_Shares_sold"<<"||"<<"Purchase_Price"<<"||"<<"Sell_Price"<<"||"<<"Amt_i nvest";