Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a text file input . txt , write a program to identify all the lexemes from the file input . txt and write the

Given a text file input.txt, write a program to identify all the lexemes from the file input.txt and write the lexemes separated by a single space into the file output.txt. Please keep in mind that all comment lines (lines that begin with //), blank lines and extra white spaces are not included in the file output.txt. Do not forget to place one space before and space after each lexeme. Note that the cin>> is one lexeme. Save it as Prog2 and upload it on Canvas.
input.txt:
//declare variables
int num1, nume2, num3,t ;
//initialize variables
num1=13; num2=55 ;
num3=17 ;
cin>> t ;
//compute and display their total
t= num1* num2-t; //compute new value for t
num1= num1+t; //compute new value for num1
Sample output.txt:
int num1, nume2, num3, t;
num1=13;
num2=55;
num3=17;
cin>>t;
t= num1*num2+num3-t;
num1=num1+t;

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

=+g. Does it deliver one, instantly understandable message?

Answered: 1 week ago

Question

=+e. Does it entertain, inform and/or engage the reader?

Answered: 1 week ago

Question

=+h. Do all of the related materials project one cohesive message?

Answered: 1 week ago