Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(40%) write a compiler tool that can scan the C++ source code file named Input-cpp and generate an output file called Input new.cpp, which will

image text in transcribed
image text in transcribed
(40%) write a compiler tool that can scan the C++ source code file named "Input-cpp" and generate an output file called "Input new.cpp", which will remove the comments of the input file. 6. You can assume the file name is fixed. And you can assume the input file is well formed, i.e., all the strings "/" and "* appear in pairs. There does not exist unpairedcommends. You need to review the functions in Chapter 3, you may need some of those functions, such as get, ignore, peak putback, etc. Although the functions introduced in Chapter 3 is for iostream, it can also be invoked by fstream. More details can be found in http://www.cplusplus.com/reference/fstream/fstream/ Sample input and output: Sample code ne Eu #include iostream> //std::cout, std: cin, l O library #includeiomanip> //stdsetwo, std::setfill() int main0 declare the variable int startHour, startMinute, endHour, endMinute; /l input std:cout > startHour std:cin.get0;// skip : read one char but do nothing std:cin >> startMinute; std:cout endHour std:cin.get0;/ skip std::cin >> endMinute /l process int hrDiff 0, minDiff 0; I ADD CODE 1 ll output / ADD CODE 2 return 0; ) I/ end mairn

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

=+Will the humor help meet the objectives?

Answered: 1 week ago

Question

1. Explain the 2nd world war. 2. Who is the father of history?

Answered: 1 week ago

Question

The company openly shares plans and information with employees.

Answered: 1 week ago