CS
010 - Introduction to Computer Science I
Assignment 2:
DUE: Fri, April 15th before 2:00pm
Limited collaboration is OK. You may do the following while writing a programming assignment: discuss general solution ideas with your study group members or have members observe a run of your program, and offer their ideas on its behavior. You should *never* look at someone else's code for the assignment to figure out how to do your own program. It is very hard to write your own unique solution once you have seen someone else's. If you need someone to look at your code to give advice, you should see your TA or instructor. Of course, copying code from ANY source (any book, current or past student, past solutions, or the web) is STRICTLY FORBIDDEN.
Code that is turned in, must be contained in a .cpp file named main.cpp. Files of ANY other format will not be graded (e.g. main.doc, main.txt, etc…).
You must turn your work in using electronic turnin as in lab1, from a lab computer on campus, TURNING IN FROM HOME WILL NOT WORK!
Turn in online to as2 folder. If you turn in to the wrong folder, your assignment may not be graded. If it is graded, you will lose 20 pts (out of 100).
Remember to include the following header information at the top
of your program;
// Course: CS 10
//
// Lecture Section: ... 001 or 002
// Lab Section: ... 021, 022, etc)
//
// Assignment #: ... assignment 2, 3, etc.
//
// Last Name: Enter your LAST (family) name here (eg, Doe)
// First Name: Enter your FIRST (given) name here (eg, John)
//
// ID Number: Enter your ID number here (eg, 860-00-0000)
// lab login id: Enter your cs10 login here (eg, jdoe)
//
// Email address: Enter your UCR email address here (eg,
jdoe@cs.ucr.edu)
//
//
=======================================================================
For this assignment
love is in the air. You will write a program that takes as input
exactly six different items; a groom's name, a bride's name, the length
of the groom's last name, the length of the bride's first name, the
groom's yearly income, and the bride's yearly income. You must
input
the last and first name of the groom into a single variable! The
same is true for the bride's last and first name. Your program
will then print out the
bride's new name, which is traditionally the first name followed by the
groom's last name. The new name should be printed out nicely,
with the
bride's first name right alligned to the word "First" above it,
followed by the new last name right alligned to the word "Last" above
it (see the screen shots below). Your program will then print out
the
newleywed's average yearly income, with a fixed decimal point, and two
numbers to the right of the decimal point.
Lastly, you need to
fill out the following form as you did for as1:
readme.txt
Download the form
into the directory containing your main.cpp file, by right clicking the
above link and selecting "Save Link Target As...". Next,
open
the file using emacs the same way you open your main.cpp files.
Fill
out the form, and save it. When you use electronic turn in, the
form
will be turned in with all the other files in your as2 directory.
Example program run 1:

Example program run 2:

20 pt(s): Correctly extracts Bride's first name from a single variable