Find Jobs
Hire Freelancers

write software in c++

₹100-400 INR / hour

Completed
Posted over 9 years ago

₹100-400 INR / hour

C++ programming Project Sometimes when a memo is boring, a programmer with some free time is tempted to make the memo more entertaining. This assignment asks you to write a C++ program “funnymemo” to make a boring memo funny by inserting adjectives into the text. The input to your program should be copied to the output, with adjectives inserted between all consecutive occurrences of an article and a noun. For our purposes in this assignment: A “word” is a sequence of characters beginning with a letter and followed by zero or more letters or digits. An “article” is one of the following words: a, an, the. Note that words may have capital letters anywhere in the word. This implies that all of the following are “articles”: a, A, an, An, aN, the, The, tHe, thE, THe, tHE, THE. For our purposes here, the word after an article is a noun, by definition. When an adjective is inserted between an article and a noun, the article should be inserted according to the following rules 1. If the noun that follows the article begins with a lowercase letter, then the adjective should be in all lowercase letters. 2. If the noun that follows the article is all capital letters, then the adjective should be all capital letters. 3. Otherwise, the adjective should begin with a capital letter and have all other letters be lowercase. 4. If the noun begins with a vowel (a, e, i, o or u), and the adjective does not, and the article is “an”, then the article should output as “a”. 5. If the adjective begins with a vowel and the article is “a”, then the article should output as “an”. Here are some examples, where the adjectives “silly” and “awkward” are added: BEFORE funnymemo AFTER funnymemo A day A silly day A day An awkward day A Walk A Silly Walk A Walk An Awkward Walk the fISH the silly fISH the fISH the awkward fISH an ANACONDA a SILLY ANACONDA an ANACONDA an AWKWARD ANACONDA Your program should accept two command line arguments. The first argument is the adjective to be inserted into the memo. The second argument is the name of a text file containing the input text for the memo. Your program should read the file named in the second argument as input and generate its output to standard [login to view URL] the program finds an article followed by a word, it should insert the adjective provided in the first command line argument, according to the rules given above. The program finishes when the end of the input file is reached. Remember that your program needs to check for errors and react appropriately. What happens if the proper number of command line arguments are not provided? What if the text file cannot be opened? What happens if there is an article on one line and the noun on the next line? What should happen in the case when the last word in the input file is an article?
Project ID: 7100504

About the project

2 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
I have experience in C/C++ and can do this porgaram for u in less than a day. Please open chat for details.
₹277 INR in 1 day
4.7 (9 reviews)
2.6
2.6
2 freelancers are bidding on average ₹277 INR/hour for this job
User Avatar
A proposal has not yet been provided
₹277 INR in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of INDIA
Calcutta, India
4.6
121
Payment method verified
Member since Jan 29, 2011

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.