CS1121 Programming Assignment 3

CS1121 Programming Assignment 3 - CS1121 Programming...

• Notes
• 1

This preview shows page 1. Sign up to view the full content.

CS1121 Programming Assignment 3 (8%) [due April.6] 1. Write a program that generates a simple calendar for one month given what day the first day is and how many days there are in that month. For example: - Input: The first day is: Thu The days in the month: 31 - Output Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Note: Probably you need to use character strings in this program, to declare a char string s1 which can contain 9 characters at most: char s1[10] ; to compare whether a char string s1 and another string s2 are equal:
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: strcmp(s1, s2); strcmp(s1, s2): The function returns an integer greater than, equal to, or less than 0, if the string pointed to by s1 is greater than, equal to, or less than the string pointed to by s2 respectively. For details, please check the C function manual. 2. Write an addition and multiplication program that can handle huge numbers. Input: 2 large numbers ( up to 30 digits ) Ex) 123456789101112131, 839382763950606 Output: addition result and multiplication result Addition: Ex)123456789101112131 + 839382763950606 = 12 … Multiplication: Ex)123456789101112131 * 839382763950606 = …...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern