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 the memory management(delete and reallocate) AND exception handling(try, throw catch) features from the readings in the text. The program should have at least 500 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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In C++ please

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 the memory management(delete and reallocate) AND exception handling(try, throw catch) features from the readings in the text. The program should have at least 500 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 _two distinct_ bugs 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 the C++ language features we are focusing on, not something very obvious on inspection. That is, don't write things like: if (input == bad_value) { delete foo; use foo; } 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. The triggering inputs for the two bugs should be different.

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

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Fundamentals of system reliability
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education