Starting from:

$30

CSCE 240 Homework 1 

CSCE 240 Homework 1 
You shall submit a zipped, and only zipped, archive of your homework directory,
hw1. The directory shall contain, at a minimum, the file base decomposer.cc. Your
submission file must be named hw1.zip.
I will use my own makefile to make your base decomposer.cc file. Do not use a header
for this assignment. My grader will not look for one.
Introduction
The most common representation of quantities in base-10 is the power series positional counting system. In
this system, 123,456 represents the power series
1 × 105 + 2 × 104 + 3 × 103 + 4 × 102 + 5 × 101 + 6 × 100
OR
100000 + 20000 + 3000 + 400 + 50 + 6
The same value presented in negative magnitude -123,456, might be
−(100000 + 20000 + 3000 + 400 + 50 + 6)
Description
Develop a small application to produce output in the second form–that is:
100000 + 20000 + 3000 + 400 + 50 + 6
OR
−(100000 + 20000 + 3000 + 400 + 50 + 6)
WITHOUT PROMPTING, read input from STDIN as a signed integer value. This can be accomplished
with std::cout and a signed int variable. Extract each place of the integer and print the conversion to
STDOUT. For this, you might use the modulus operator and integer division.
There is a python application file to test your code. You should ensure that your code satisfies the tester’s
requirements. It is the tool I will use to grade your submissions. I will only change the input and expected
values.
To utilize the tester, you will need access to a python3 interpreter. The tester can be called as follows,
assuming that python3 is in your path and that your present working directory is ../hw1
python3 test_decomposer 1
python3 test_decomposer 2
CSCE 240 Homework 1 Page 2 of 2
Point Awards ˆStyle: 2 points ˆCompilation: 1 point ˆTest 1: 1 point ˆTest 2: 1 point
You have been provided a makefile. You should definitely read the makefile and are encouraged to read the
python tester.
Late assignments will lose 10% per day late, with no assignment begin accepted after 3 days (30% reduction in points).
Check your syllabus for a further breakdown of grading.
The End.

More products