Assignment #1
CS 162: Introduction to Computer Science
Submit your assignment
to the D2L Dropbox
Email a backup copy to karlafgr@cs.pdx.edu
***Assignments
in CS162 consist of written homework and programming***
The written
portion MUST be turned in to get a grade on an assignment
LATE work
will be accepted – but ONLY within a week of the original due date.
We do not
accept late work beyond that. There are no exceptions.
1.
Create
an Algorithm for the process of how to be successful with this
course. Think about what you will need to do this term, in a step by step
fashion, to be successful in CS162. This should include when and how you will
watch (or attend) course lectures, your plan for the labs, readings, and so on.
This algorithm is especially important for those of you online students –
getting behind is one of the biggest risks of taking this course online!
Things
to think about…Is there any prep work that needs to take place for
you to be successful? Do you make a habit of writing small programs to solidify
constructs? How do you plan to stay on track? Think of (a) what you will need
to do (read the syllabus…etc.) (b) when you need to do each of these, and then
(c) think about how best you learn and what you will need to do to take what is
discussed or taught and be able to apply it.
Algorithms
should be written in outline form using complete sentences.
2. Ethics. In Computer Science we are responsible for the
software that may have a much larger impact on people lives than we imagine. Over
the last few months there have been many major web site revisions (my bank for
example). The user interface is improved, but now it takes so long to load and
I can’t get access to transactions earlier than 90 days. Now without printed
statements, I have no access without ordering statements to review past history
with no notification. Is this ethical? Have you experienced changes online that
don’t seem right? At what point are changes
not ethical? Write 5 complete sentences with your thoughts about these ethical concerns.
3.
Programming
Assignment
Overview
The purpose of this first
program is get you familiar with the fundamental syntax of C++ and the process
of writing and turning in programs at PSU. Once you read the assignment, you
will realize that it really is part of a much larger project – to which we will
not be implementing at this time. So, it is just to demonstrate some simple
interactions between the user and program. For those of you who already know
C++, use this program as a refresher and stretch yourself to do more than is
assigned! The first part of the program needs to be an algorithm.
Specification
I was just having a conversation with my mom and she was convinced that
it was 20 degrees yesterday (obviously her car thermostat was not accurate). So
I started search the web for information about the weather and although I found
current, forecasted weather and historical (1 year ago), finding the last
week’s averages were not as simple.
Your job is to create a program that
prompts the user for weather information for the last week (low, high, amount
of rain, and wind). Your program should also show how well the forecasters
predicted – so if they said there was a 90% chance of precipitation, did it
actually rain?
Your job will be to:
1.
Prompt
and read from the user for each of the above amounts for a given day (low
temperature, high temperature, amount of rain, and wind speed).
2.
Prompt
and read from the user what was forecasted for that day
3.
Echo
the amounts read in
4.
Your
software will calculate the high, low, averages from what was read
5.
Then
calculate how relevant the forecast was
6.
Do
this again for a 5 day period or until the user wants to quit
7.
Display
the results including the performance of the forecasters!
8.
Allow
the user to start again with different values (from scratch) if they desire
9.
EXTRA
CREDIT will be given to individuals that work ahead and start to incorporate
arrays to hold the temperatures for each day of the week. This, however, is not
required.
Things
you should know...as part of your program:
1.
Make
sure to prompt the user for any input requested. Make sure it is clear from
your prompts what the user is expected to do.
2.
The
program should continue until the user wants to quit. Allow them to continue
until they are done.
3. You
may not use any global variables in this program!
4. You
may not use the string class but you are allowed to use arrays.
5.
Make
sure to use C++’s I/O (iostream library) for your input and output.
6.
Although
functions are not required for this assignment, they are always advised!
To
get full credit for the programming portion, you will need to:
1.
Turn in an algorithm written using full English
sentences (the algorithm will be pass/no-pass for the first assignment).
2.
Program using a consistent style of indentation,
header comments for each function, inline comments for each major block of code
3.
Submit an electronic copy of your .cpp file as
an attached file to the dropbox on D2L (go to:
http://d2l.pdx.edu/ to login). Make sure to
hit the submit button after uploading your files (otherwise they will be lost)
4.
As a backup, please also email your work (as
attached file(s)) to karlafgr@cs.pdx.edu.
This is REALLY important if the code is not properly submitted to D2L or if D2L
is down. However, the grader DOES NOT grade from this location – it is purely a
backup system.