You are on page 1of 2

Computer Programming Autumn 2021

Programming Assignment

Write an analysis and design for the following question. Use the format shown
in class , write this part as a comment block in the implementation source file.
You could follow Google C++ Style Guide. As stated in the syllabus, part of the
grade on a programming assignment depends on how well you adhere to the
guidelines. The grader will look at your code listing and grade it according to the
guidelines.

Questions
Source code: bignumber.cpp
Input file: $test_no$.in
Output file: $test_no$.out
Time limit: 3.0 s
There are a number of expressions between big integers which you must
compute. Each expression is written with the following format:
<big integer> <operator> <big integer>
where a big integer is positive and not exceeding 101000, and an operator
may be * or +.
For example:
100000000000 * 20091124
100000000000 + 20091124
Please write a programme which reads those expressions from input file
$test_no$.in. After that, evaluate those expressions and write their results into
output file $test_no$.out, in which $test_no$ is the testcase number:

Input file: 1.in


The first line writes an integer N which is the number of expressions.
Subsequently, each line in N following lines contains an expression. It is known
that all these expressions are valid or computable.
1
Output file: 1.out
For each expression in the input, write its result in a line of this output file.

1.in 1.out
2 2009112400000000000
100000000000 * 20091124 100020091124
100000000000 + 20091124

Requirements:
In this exercise, you have to use linked list to save memories since the number
of digits is unidentified before.
Score:
 30% for your design. You must use class design (evaluated higher) or at
least struct design.
 10% for your programming style.

You might also like