Homework 2 (due:April 17th) Deadline : April 17th 11:59pm Where to submit? eClass “ 과제방 ” (http://eclass.cau.ac.kr) How to submit? Create a folder. The.

Slides:



Advertisements
Similar presentations
C++ Basics March 10th. A C++ program //if necessary include headers //#include void main() { //variable declaration //read values input from user //computation.
Advertisements

Exercise 4 1. Write a program that simulates coin tossing. For each toss of the coin the program should print Heads or Tails. Let the program toss the.
Introduction to C++ September 12, Today’s Agenda Quick Review Check your programs from yesterday Another Simple Program: Adding Two Numbers Rules.
1 Homework Reading –Tokheim, Section 5-10, 7-4 Machine Projects –Continue on MP4 Labs –Continue labs with your assigned section.
Software Development Method. Assignments Due – Homework 0, Warmup Reading – Chapter 2 –
CS150 Introduction to Computer Science 1
1 10/9/06CS150 Introduction to Computer Science 1 for Loops.
1 Gentle Introduction to Programming Tirgul 2: Scala “hands on” in the lab.
Basic Input/Output and Variables Ethan Cerami New York
Programming is instructing a computer to perform a task for you with the help of a programming language.
ACM Web Development Workshop - PHP By Luis Torres.
Computer Architecture B-tree construction & Traversal YongSoo Bae Room 236, Engineering Building [Project 1]
Homework #3: Classes and Constructors
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
How to start Visual Studio 2008 or 2010 (command-line program)
Summary. Data Types int A; I am declaring a variable A, which is an integer.
NA2204.1jcmt CSE 1320 Intermediate Programming C Program Basics Structure of a program and a function type name (parameters) { /* declarations */ statement;
National Tsing Hua University ® copyright OIA National Tsing Hua University HSA HW2.
THE BASICS OF A C++ PROGRAM EDP 4 / MATH 23 TTH 5:45 – 7:15.
CS Class 08 Today  Exercises  Nested loops  for statement  Built-in functions Announcements  Homework #3, group solution to in-class.
Classes. Student class We are tasked with creating a class for objects that store data about students. We first want to consider what is needed for the.
Homework #2: Functions and Arrays By J. H. Wang Mar. 20, 2012.
Objective: Students will be able to: Declare and use variables Input integers.
Project 3: Ticket Printer
Homework #2: Functions and Arrays By J. H. Wang Mar. 24, 2014.
11/10/2016CS150 Introduction to Computer Science 1 Last Time  We covered “for” loops.
Exercise 3 Example> Write a C function that implements /* input : integer value n output : */ int f ( int n ) { int i, sum=0; for (i=1;i
Learners Support Publications Introduction to C++
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Computer Programming for Engineers
1 Project 3 String Methods. Project 3: String Methods Write a program to do the following string manipulations: Prompt the user to enter a phrase and.
Introduction to Programming Python Lab 5: Strings and Output 05 February PythonLab5 lecture slides.ppt Ping Brennan
Homework 1 (due:April 10th) Deadline : April 10th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
Homework 1 (due:April 8th) Deadline : April 8th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The name.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
CSE 251 Dr. Charles B. Owen Programming in C1 Pointers and Reference parameters.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Homework 1 (due:April 13th) Deadline : April 13th 11:59pm Where to submit? eClass 과제방 ( How to submit? Create a folder. The name.
Exercise 2 : Using for loop Repetition (loop) (1)control variable initialization (2)Test Conditon (3)Modification of control variable value order : (1)
Introduction to Programming
Homework 3 (due:May 27th) Deadline : May 27th 11:59pm
Data Types and Conversions, Input from the Keyboard
Variables, Expressions, and IO
Homework 3 (due:June 5th)
106 Data Structure Homework 1
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
CSCE 206 Lab Structured Programming in C
Programming in JavaScript
Homework Reading Tokheim, Section 5-10, 7-4.
There are 10 types of people of people in this world…
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Programming in JavaScript
How Computers Work Part 1 6 February 2008.
Programming in JavaScript
Programming in JavaScript
Introduction to C Programming
Homework 2 (due:May 15th) Deadline : May 15th 11:59pm
Homework 1 (due:April 17th)
Homework 2 (due:May 5th) Deadline : May 5th 11:59pm
Exercise 5 1. We learned bubble sort during class. This problem requires you to modify the code for bubble sorting method to implement the selection sorting.
National Chiao Tung University
CSCE 206 Lab Structured Programming in C
CSCE 206 Lab Structured Programming in C
Homework 2 (due:May 13th) Deadline : May 11th 11:59pm
CS 11 – April 1 Review steps for lab #3
Presentation transcript:

Homework 2 (due:April 17th) Deadline : April 17th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The name of the folder should be “studentID#.hw2”. (ex) hw2 We have four problems in hw2. Make three C source files. The name of the source files should be the format “studentID#.hw2.#.c” (ex) hw2.1.c, hw2.2.c, hw2.3.c, hw2.4.c In each source file.c, your code must have comments that include your name and student_id# Put the four source files into the folder we created. Compress the folder into a zip file. The name of the zip file should be “student#.hw2.zip”. (ex) hw2.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.

1. Write a program that reads an integer N (0<=N<= ) from keyboard and prints the sum of its digits as an output. #include int main() { int N; // you may declare variables here scanf(“%d”,&N); // put your code here return 0; } Input example 37 output example 

2.Input an integer B containing only 0 and 1 (i.e.,a binary integer) and print its decimal equivalent. Assume the total number of the binary digits is less than 10. #include int main() { int B; // you may declare variables here scanf(“%d”,&B); // put your code here return 0; } Input example 91 output example 

3.Write a C program that inputs an integer N and prints the following diamond shape where middle line has N asterisks(*). (Assume N is an odd number that is less than 30.) #include int main() { int N; // you may declare variables here scanf(“%d”,&B); // put your code here return 0; } output example * *** ***** ******* ********* ******* ***** *** * 9 Input example

4. One interesting application of computers is histogram. Write a program that reads three numbers (each between 1 and 30). For each number read H, your program should print a line containing that number H and H adjacent asterisks. For example, if your program reads the number seven, it should print 7:*******. Be careful about the alignment. #include int main() { int h1,h2,h3; // you may declare variables here scanf(“%d %d %d”,&h1,&h2,&h3); // put your code here return 0; } Input example 3:*** 15:*************** 8:******** output example