ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 09 May 2017 My Price 9.00

Part 1: Date Calculation

I am needing help with 2 programs in IT 2240 for Capella University which is intro to programming.  

Part 1: Date Calculation

Write a program that asks the user for a date in the format mm/dd/yyyy, using a custom struct to store the date information entered in memory. The program should call a custom function that adds seven days to the user's date, passing in the data in and out of the custom function using the custom struct for the dates. The program should then print out the original date entered and the date one week later. As always, be sure to format your C code correctly and include meaningful comments to explain what the code does and how it works.

Part 2: Simple Grade Book, Version 3.0

Modify the grade book program from Unit 3 to use a custom struct to hold the student's ID number and the percentage score for each item in the grade book. The program should accept the entry of ID numbers and percentage grades (0-100) until the user signals that he or she is done entering grades. The program should then print out the ID numbers and grades entered by the user, sorted by ID number. Again, be sure to format the code properly and provide comments in the C code.

Part 2 code:

#include <stdio.h>

#define MAX_GRADE_COUNT 100

int main(void){
    int grade[MAX_GRADE_COUNT];// sets array size
    int i;
    int count = 0;
    char continueResponse;

    printf("nEnter grades 1 at a time (up to %d grades).n", MAX_GRADE_COUNT);// allows user to enter grades up to max designated

    for(i = 0; i < MAX_GRADE_COUNT; i++){// tells program if i is less than 100, continue loop
        printf("Enter grade (0-100): ");
        scanf("%d", &grade[i]);
        count++;
        printf("Continue? (Y/N): ");
        scanf(" %c", &continueResponse);// stores answer to memory
        if(continueResponse == 'n' || continueResponse == 'N'){// tells program anything other than n/N will continue loop
            printf("n == End of Grade Entry == n");
            break;
        }
    }

    printf("Grades: n");
    for(i = 0; i < count; i++){// prints on screen only number of grades entered into memory
        printf("t%dn", grade[i]);
    }

    return 0;

}

Answers

(11)
Status NEW Posted 09 May 2017 07:05 AM My Price 9.00

-----------

Not Rated(0)