Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Write a program reading input from the user. I do not particularly care how (via a file, or making them type something in, or

1. Write a program reading input from the user. I do not particularly care how (via a file, or making them type something in, or a command line argument via argc/argv). What this program does is up to you, but it should use a variety of features of C++ discussed in Chapters 1-3(Types, Control flow, functions, classes, and pointers). The program should have at least 300 lines of code, as measured by cloc, and it should only require standard C++ libraries, no unusual packages -- the code should compile and run as-is easily on Mac and linux platforms.

2. The program should do something interesting; again, what is really up to you, but you should be able to explain the purpose of the computation in a comment at the top!

3. You'll want to prepare a second version of the program that _is broken_. You should introduce a bug into the program so that for some (but not all!) user inputs, the program does _not_ do what it should. This should be a matter of incorrect use of C++ language features, not something very obvious on inspection. That is, don't write things like:

if (input == bad_value) {

go_haywire();

}

instead have the bad values somehow cause issues, perhaps by omitting a check for valid input that is in your first version of the code.

4. What you submit is a pdf report with both source code versions and an explanation of what your program does, what the bug is, what language feature it mis-uses, and how hard you think it would be to detect the bug. The report should be at least 1000 words, not counting the code listings.

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

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

Is this public actively seeking information on this issue?

Answered: 1 week ago

Question

How much loyalty does this public have for your organization?

Answered: 1 week ago

Question

How influential does the organization see this public as being?

Answered: 1 week ago