Create program that reads insertion and deletion instruction

Assignment Help C/C++ Programming
Reference no: EM131958642

Project Assignment

Introduction: Some mathematical computations are extremely complex and time-consuming for a computer to perform. Often, we resort to a look-up table instead, where outputs are pre- calculated and stored in a file. Mathematical functions that fall into this category include trigonometric functions (sine, cosine, tangent, etc.), roots, and logarithms.

Task: You are to create a program that reads insertion and deletion instructions concerning natural numbers (i.e. integers with value zero or greater) from an input text file and writes a table of integers and corresponding base 10 logarithms to an output text file.

Requirements:

1. The program will be graded using Cygwin and g++.

2. The input file will contain one operator / operand pair per line, with the two values separated by white space. The output file shall contain one integer / logarithm pair per line, with the two values separated by a tab. The logarithms shall be printed as floating-point values with 4 digits after the decimal point.

3. Valid operators are "a" (add) and "d" (delete).

4. Valid operands in the input file will be natural numbers between 0 and 99. There is no limit to the size of the input file. Entries in the input file will not be ordered.

5. The output file must be sorted in ascending order (smallest to biggest).

6. Duplicate adds in the input file must be ignored (only one corresponding entry in the output file). Non-existent removes should also be ignored.

7. Include a makefile that builds your complete solution.

8. The program will expect 2 command-line arguments to specify the names of the input and output files. Example command-line input:

$ .\LogTable.exe input.txt output.txt

9. Malformed command-line syntax and/or failure to open input or output files shall result in an error message and program termination.

10. Integers shall be stored in a sorted binary tree. You must use dynamic memory allocation and deallocation. Your binary tree class should support insertion of nodes, deletion of nodes, and ordered writing of the entire tree to a text file.

11. Dynamically allocated memory must be freed before program termination.

12. Submit a single zip file that contains all your source code and your makefile.

Example Files:

If the input file appeared like this:

a   66
a   79
d   84
a   63
a   10
a   53
a   10
a   66
a   43
d   66
a   70
a   44
d   66
d   79
d   63
d   10

The associated output file should look like this:

43   1.6335
44   1.6435
53   1.7243
70   1.8451

Notice that the output file data is in ascending order and duplicates have been removed. Think about different input file scenarios and craft appropriate input files to test those scenarios.

Reference no: EM131958642

Questions Cloud

Examine factors of digital media and degree of acceptance : For this week's Discussion, you examine factors of digital media and its degree of acceptance or potential for anxiety by older adults.
Create a memo that outlines the differences : One of the activities recommended by BPSC is to perform a penetration test. Create a memo that outlines the differences and what your recommendation would be.
Prepare an annual line-item budget for wilburtown health : Prepare an annual line-item budget for Wilburtown Health Clinic. You may use the EXCEL template provided if you wish, but this is optional.
Discuss the psychological tests : In this assignment, you will be critiquing two psychological tests, a personality test and an intelligence test. You will be critiquing the following categories
Create program that reads insertion and deletion instruction : You are to create a program that reads insertion and deletion instructions concerning natural numbers from an input text file and writes a table of integers.
Create a new company data file using MYOB : The business is a book retailer named Yabby Books Pty Ltd. Create a new company data file using MYOB. Process transactions for July
Make sense to replace your incandescent bulbs today : If you require a 9 percent return, at what cost per kilowatt-hour does it make sense to replace your incandescent bulbs today?
Explain the concept of feeling in detail : Carl Rogers, a humanistic psychologist, believed that individuals must feel accepted for who they are in order to have a high level of self-worth.
The power of government to regulate for public health : The power of government to regulate for the public health, safety, and welfare is known as:

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd