Skip to content

pdbarnesCSUF/isds309_hw1

Repository files navigation

Assignment 1 - Chapter 2 - A

https://moodle-2018-2019.fullerton.edu/mod/assign/view.php?id=971229

Due: Tuesday, Sept 25, 4 pm (before class)

*** Please complete the following 10 exercises.

Chapter 2, end of chapter exercises: 6, 8, 9, 10, 12, 13, 14, 15, 16, 17

Attention

Only upload the file "program.cs" for each exercise to Titanium. That is the file that contains the code you have written. before uploading it to Titanium, rename the file program.cs to FILENAME.txt and then upload the file. (FILENAME is the name that the each exercise has provided for each program)

For example after completing exercise 6 (InchesToCentimeterActive),

    Copy the file "program.cs" to a new location (that way you don't lose the original program.cs file). 
    Rename the newly copied file "program.cs" to "InchesToCentimeterActive.txt" 
    Upload the file "InchesToCentimeterActive.txt" to Titanium. 
    Repeat these steps for the other exercises.

Good luck,


InchesToCentmeters (5)

Write a C# program named InchesToCentmeters that declares a named constant that holds the number of centimeters in an inch: 2.54. Also declare a variable to represent a measurement in inches, and assign a value. Display the measurement in both inches and centimeters—for example, 3 inches is 7.62 centimeters.

6

Convert the InchesToCentimeters program to an interactive application named InchesToCentimeterslnteractive. Instead of assigning a value to the inches variable, accept the value from the user as input.

ProjectedRaises (7)

Write a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4 percent raise for each employee in a company. Also declare variables to represent the current salaries for three employees. Assign values to the variables, and display, with explanatory text, next year’s salary for each employee.

8

Convert the ProjectedRaises class to an interactive application named ProjectedRaisesInteractive. Instead of assigning values to the salaries, accept them from the user as input.

9

Malcolm Movers charges a base rate of $200 per move plus $150 per hour and $2 per mile. Write a program named MoveEstimator that prompts a user for and accepts estimates for the number of hours for a job and the number of miles involved in the move and displays the total moving fee.

10

Write a program named HoursAndMinutes that declares a minutes variable to represent minutes worked on a job, and assign a value to it. Display the value in hours and minutes. For example, 197 minutes becomes 3 hours and 17 minutes.

Eggs (11)

Write a program named Eggs that declares four variables to hold the number of eggs produced in a month by each of four chickens, and assign a value to each variable. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.

12

Modify the Eggs program to create a new one named EggsInteractive that prompts the user for and accepts a number of eggs for each chicken.

13

Write a program named MakeChange that calculates and displays the conversion of an entered number of dollars into currency denominations—twenties, tens, fives, and ones. For example, $113 is 5 twenties, 1 ten, 0 fives, and 3 ones.

14

Write a program named TestsInteractive that prompts a user for eight test scores and displays the average of the test scores to two decimal places.

15

Write a program named FahrenheitToCelsius that accepts a temperature in Fahrenheit from a user and converts it to Celsius by subtracting 32 from the Fahrenheit value and multiplying the result by 5/9. Display both values to one decimal place.

16

Create an enumeration named Month that holds values for the months of the year, starting with JANUARY equal to 1. Write a program named MonthNames that prompts the user for a month integer. Convert the user’s entry to a Month value, and display it.

17

Create an enumeration named Planet that holds the names for the eight planets in our solar system, starting with MERCURY and ending with NEPTUNE. Write a program named Planets that prompts the user for a numeric position, and display the name of the planet that is in the requested position

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages