1. The first assignment exercises the I/O knowledge gained.

  • Write a program that will ask a user for their first name and then their last name.
  • Store the name values in string variables (with meaningful names).
  • Print several blank lines, then print out the user's name in the following ways, 1 per line:
    • first_name last_name
    • last_name, first_name
  • Then finish by printing 2 blank lines

2. The second assignment will demonstrate mathematical operations.

  • Request two integer numbers from the user
  • Declare a variable to hold the answer to each equation
  • Print out, using the format specified below, the sum, difference, product. quotient, modulus, and true quotient (showing fractional part) of number1 by number2.
    • format for output, 1 per line
    • number1 operator number2 = answer
    • where operator is +, -, *, /, %, and /
  • print 2 blank lines at the end
  • Use the following values as input: 17 and 5
  • You may test it with any other values you desire

For each assignment this week, all code may be written inside of the main() routine.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.