-3

im pay $30 to some that can finsh this for me
Project #1 and #2 Specifications

You are required to design a calculator. This calculator reads commands from data files called
CommandsProj1.dat and CommandsProj2.dat, which I will email to you.
Your program should read the commands in sequential order, process them, perform the necessary
calculations, and then print out the results in a neat, readable manner, both to a file and to the screen.

The first line of the file contains two characters giving the initials of the user (such as GN). The rest of the
file consists of a sequence of commands. Each line of the command file contains one command.
Each command starts with a character and may have zero or more operands. You may assume that the
data file has no errors. The number of commands in the file is unknown. But your processing may stop
as soon as the Quit command is processed. The commands are: integer add, integer subtract, integer
multiply, integer divide, change to uppercase, change to lowercase, separate, print out all digits, print
out the k-th digit, round real number to desired number of decimal places, divide number into two.

Add integers i and j and print out result

Multiply integers i and j and print out result

Subtract integer j from i and print out result

Divide integer i by j and print out result of integer division

C Ch [Character Case Change ] Change character Ch to uppercase and print it out

Change character Ch to lowercase and print it out

Print out the k-th digit of integer i

Round double value x to i decimal places

Separate out the sign, integer part and fractional part of double value x

Given integers i and x, print out two integers j and k, where the sum of j
and k equals i, and when you take x% of i and truncate it you get j

Print a short synopsis of all the available commands

Quit

For Project 1, you will only have to implement commands: +, -, *, /, H, Q.
You must submit the C file(s) and a word document containing your engineering problem solving
methodology for Project 1.

For Project 2, you will need to implement the rest.
You must submit the C file(s) for the entire Calculator and a word document containing your engineering
problem solving methodology for the entire Calculator project (Project 1 and 2 combined).

Command Notes:
1. There is always a space between the command character and the operands (if any).
2. For the division operation, the second operand will never be a 0.
3. For the operation that changes to uppercase, you will always be given a character that is a lowercase
letter of the alphabet (never an uppercase letter of the alphabet, a digit, a punctuation, or a special
character).
4. For the operation involving rounding a double value to the right decimal point, the output may have
trailing 0's to pad it at the end. So the output for command \R 3.567 1" may be 3.6000. You will not
be asked to round a negative number.

Programming Notes:
1. Print out a short synopsis of all the commands at the start of the program in order to guide the user.
2. Make sure that your output echoes the commands you read in from the file and provides the output
in a readable format.
3. Make sure you separate the output of one command from the next.
4. Start with 2 basic operators (Add and Quit), prepare a file with just these 2 commands and get your
program tested and working for it. Then move on to other commands, one by one. If you have not
gotten one of the commands to work, then make a dummy function that simply prints out a message
saying “Function Z not implemented yet!”

Edited by deceptikon: Closed as homework violation

2
Contributors
1
Reply
26
Views
4 Years
Discussion Span
Last Post by <M/>