Home » Computer Science Question

Computer Science Question

Purpose

The purpose of this assignment is to provide the student an opportunity to demonstrate knowledge of the various decision structures such as the if, else if, and switch statements.

Assignment Instructions

You will complete a program to demonstrate the skills presented in this lesson using C#. Please keep in mind that with all the assignments in this course, any given scenarios are hypothetical and intended solely to demonstrate specific skills.

Assignment Requirements

The program for this assignment will consist of four sections, each headed by the three-line comment below:

//*********************************************************

//****Assignment 2 Section X

//*********************************************************

(where X stands for the portion of the assignment to follow)

Section 1:

  1. Enter the comment with the section title.
  2. Request the user to enter two whole numbers and store those whole numbers in two appropriately defined variables.
  3. Using separate and independent IF statements, compare the two whole numbers with each of the following comparison operators. ==, !=, <, >, <=, >=
  4. Each IF statement that proves true should print to the console the numbers compared and the comparison made. e.g., “5 > = 2”

Hint: If the user enters the numbers 5 and 2 then the expected output would be:

5 <> 2

5 > 2

5 >= 2

Section 2:

Enter the comment with the section title.

  • Request the user to enter a grade.
  • Using an if statement with an else clause, compare the user input with the number 60.
  • If the grade entered is greater than or equal to 60 then print to the console, “

    Congratulations, you passed

    .”

  • If the grade is below 60 then print to the console, “Sorry, you failed.”
  • Section 3:

      Enter the comment with the section title.

    1. Request the user to enter a number, 1 through 12, which will represent the month of the year.
    2. Using an if statement with a series of else if statements, determine which month was entered.
    3. Write the name of the month to the console.
    4. Write an error message if the number proves to be invalid.

    Section 4:

      Enter the comment with the section title.

    1. Request the user to enter a number, 1 through 7, which will represent the day of the week.
    2. Using a switch statement, determine which day of the week was entered.
    3. Write the name of the day of the week to the console.
    4. Write an error message if the number proves to be invalid.

    POSSIBLE EXPECTED OUTPUT

    Enter first integer: 3

    Enter second integer: 9

    3 <> 9

    3 < 9

    3 <= 9

    Enter grade and determine whether you passed: 60

    Congratulations, you passed

    Enter the number of the month: 7

    The Month is July.

    Enter the number of the day of the week: 1

    Sunday

    Directions for Submitting Your Assignment

    The source code file is the file in your project that contains the code you wrote. You will only need to submit the source code file for your program and not the entire project folder or any additional project files.

    Place your order
    (550 words)

    Approximate price: $22

    Calculate the price of your order

    550 words
    We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
    Total price:
    $26
    The price is based on these factors:
    Academic level
    Number of pages
    Urgency
    Basic features
    • Free title page and bibliography
    • Unlimited revisions
    • Plagiarism-free guarantee
    • Money-back guarantee
    • 24/7 support
    On-demand options
    • Writer’s samples
    • Part-by-part delivery
    • Overnight delivery
    • Copies of used sources
    • Expert Proofreading
    Paper format
    • 275 words per page
    • 12 pt Arial/Times New Roman
    • Double line spacing
    • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

    Our guarantees

    Delivering a high-quality product at a reasonable price is not enough anymore.
    That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

    Money-back guarantee

    You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

    Read more

    Zero-plagiarism guarantee

    Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

    Read more

    Free-revision policy

    Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

    Read more

    Privacy policy

    Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

    Read more

    Fair-cooperation guarantee

    By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

    Read more

    Order your essay today and save 30% with the discount code ESSAYHELP