1 / 4

Homework 1 (due:April 10th)

Homework 1 (due:April 10th). Deadline : April 10th 11:59pm Where to submit? eClass 과제방 (http://eclass.cau.ac.kr) How to submit? Create a folder. The name of the folder should be “studentID#.hw1”. (ex) 20111499.hw1

jbuggs
Download Presentation

Homework 1 (due:April 10th)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework 1 (due:April 10th) • Deadline : April 10th 11:59pm • Where to submit? eClass 과제방 (http://eclass.cau.ac.kr) • How to submit? • Create a folder. The name of the folder should be “studentID#.hw1”. (ex) 20111499.hw1 • We have three problems in hw1. Make three C source files. The name of the source files should be the format “studentID#.hw1.#.c” • (ex) 20111499.hw1.1.c , 20111499.hw1.2.c , 20111499.hw1.3.c • In each source file .c, your code must have comments that include your name and student_id# • Put the three source files into the folder we created. • Compress the folder into a zip file. The name of the zip file should be “student#.hw1.zip”. (ex) 20111499.hw1.zip • Upload the zip file into eClass website. • If you don’t follow above instructions, you may get penalty in your score. • You must do programming yourself.

  2. 1. Write a program that reads an arbitrary positive integer and prints the sum of its digits as an output. #include <stdio.h> int main() { int num; scanf(“%d”,&num); // put your code here return 0; } Input example 421376 output example 23

  3. 2. Write a C program that output as follows. You must use for-loop appropriately. #include<stdio.h> int main() { ; for () { for () ______________; for () ______________; ; } for () { for () ; for () ; ; } return 0; } Output : * *** ***** ******* ********* ******* ***** *** *

  4. 3. Write a program that gets a starting principal(A, 원금), annual interest rate(r, 연이율) from a keyboard (standard input) and print the total amount on deposit (예치기간이 지난 뒤 총금액, 원리합계) for the year(n) from 0 to 10. total deposit = A*(1+r)^n For example, 1000.0 0.05 <- keyboard input // 5% should be written as 0.05 0 1000.00 1 1050.00 2 1102.50 3 1157.62 4 1215.51 5 1276.28 6 1340.10 7 1407.10 8 1477.46 9 1551.33 10 1628.89

More Related