Do as many (or few) of the following problems as you like. Notice that you can receive at most 30 extra-credit points, but be advised that any points you earn can only help your grade -- that is, I will add them to your total points before dividing by the sum of the ``perfect score'' points on the required assignments.
I am also open to the possibility of giving extra credit for other work -- other problems/programs, a report on something course-related, etc. If you have an idea for such a project, let's negotiate (by e-mail).
NOTE that the usual rules for collaboration do not apply to this assignment. More in the following section.
Please include with each part of the assignment the Honor Code pledge or just the word ``pledged'', and the statement ``This assignment is entirely my own work'' (where ``my own work'' means ``except for anything I got from the assignment itself, such as starter code, or from the course Web site or sample solutions to other assignments). For this assignment you should not work with or seek help from other students or from tutors, but you can consult other sources (other books, Web sites, etc.), as long as you identify them.
Do as many of the following programming problems as you choose. You will end up with at least one code file per problem. Submit your program source (and any other needed files) by sending mail to bmassing@cs.trinity.edu with each file as an attachment. Please use a subject line that mentions the course and the assignment (e.g., ``csci 1120 hw X'' or ``LL hw X''). You can develop your programs on any system that provides the needed functionality, but I will test them on one of the department's Linux machines, so you should probably make sure they work in that environment before turning them in.
Now is the time for all good persons to come to the aid of their party. A really long word, though perhaps not the longest in English, is "antidisestablishmentarianism" (28 letters).it would produce the following
1 * 2 ****** 3 ******** 4 ***** 5 ** 6 ** 7 ***** 8 9 10 11 12 13 14 15 16 17 18 19 >=20 *(Notice that it groups all words of length at least 20 into a single output line -- simpler to code and in my opinion reasonable.) To get maximum points, your program should do the following:
% mypgm degree of polynomial (highest power)? 3 coefficients (starting with highest power)? 2 4 3 5 p(x) = 2.000000(x**3) + 4.000000(x**2) + 3.000000(x**1) + 5.000000 x? 10 p(10.000000) = 2435.000000 x? 100 p(100.000000) = 2040305.000000 x? invalid inputand one getting them from the command line:
% mypgm 2 3 4 5 p(x) = 5.000000(x**3) + 3.000000(x**2) + 4.000000(x**1) + 2.000000 x? 10 p(10.000000) = 5342.000000 x? 100 p(100.000000) = 5030402.000000 x? invalid input
% mypgm
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
1 in cm
1 in is 2.54 cm
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
2.54 cm in
2.54 cm is 1 in
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
10 ki mi
unknown conversion
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
10 km mi
10 km is 6.21371 mi
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
10 km miles
invalid input
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
1 ft m
1 ft is 0.3048 m
enter amount and two units (control-D to end)
possible conversions:
in to cm
cm to in
ft to m
m to ft
mi to km
km to mi
1 m ft
1 m is 3.28084 ft
To get maximum points, your program should do the following:
typedef struct {
char *from_unit;
char *to_unit;
double factor;
} conversion_t;
conversion_t factor = { "in", "cm", 2.54 };
(You can use a different struct if you think of
one that seems better to you.)
Hello! Now is the time for all good persons to come to the aid of their country. ABCD 1234 !@#$ Goodbye!encrypted with keyword abcd gives
Hfnoo! Oqz it vke ukpe gqu amn jopf sesurnt vr cpoh tp vke bkg og vkejt fovpwrz. CECE 1234 !@#$ Iroedbe!(If this sounds interesting to you, feel free to ask for hints on how to proceed. I won't include them here for reasons of time.)