Homework 2 (due:May 13th) Deadline : May 11th 11:59pm

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

/* C Programming for the Absolute Beginner */ // by Michael Vine #include main() { printf(“\nC you later\n”); system(“pause”); }
Summary. Data Types int A; I am declaring a variable A, which is an integer.
National Tsing Hua University ® copyright OIA National Tsing Hua University HSA HW2.
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.
Project 3: Ticket Printer
Homework #2: Functions and Arrays By J. H. Wang Mar. 24, 2014.
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
Operating System Discussion Section. The Basics of C Reference: Lecture note 2 and 3 notes.html.
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.
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.
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 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Homework 2 (due:April 17th) Deadline : April 17th 11:59pm Where to submit? eClass “ 과제방 ” ( How to submit? Create a folder. The.
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)
1 Project 6: Northwind Orders. 2 The Northwind Traders Database The Northwind Traders database was created by Microsoft for training and demonstration.
UMBC CMSC 104 – Section 01, Fall 2016
Jie(Jay) Wang Week1 Sept. 30
CMPT 201.
Homework 3 (due:May 27th) Deadline : May 27th 11:59pm
Formatted Input/Output
Data Types and Conversions, Input from the Keyboard
CS1010 Discussion Group 11 Week 4 – Overview of C programming.
Arrays Declarations CSCI N305
Variables, Expressions, and IO
Homework 3 (due:June 5th)
Formatted Input/Output
2008/10/22: Lecture 12 CMSC 104, Section 0101 John Y. Park
Administrative things
Input/Output Input/Output operations are performed using input/output functions Common input/output functions are provided as part of C’s standard input/output.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Lecture 13 Input/Output Files.
Chapter 2 - Introduction to C Programming
Chapter 2 - Introduction to C Programming
2008/10/22: Lecture 12 CMSC 104, Section 0101 John Y. Park
CSCE 206 Lab Structured Programming in C
Chapter 2 - Introduction to C Programming
Programming in JavaScript
Homework Reading Tokheim, Section 5-10, 7-4.
Arrays, Part 1 of 2 Topics Definition of a Data Structure
Chapter 2 - Introduction to C Programming
Pointers.
Conversion Check your class notes and given examples at class.
Computing Fundamentals
Your questions from last session
Suppose I want to add all the even integers from 1 to 100 (inclusive)
Programming in JavaScript
Building Java Programs
Programming in JavaScript
Programming in JavaScript
Homework 2 (due:May 15th) Deadline : May 15th 11:59pm
Homework 1 (due:April 17th)
Chapter 2 - Introduction to C Programming
Homework 2 (due:May 5th) Deadline : May 5th 11:59pm
More Loops Topics Counter-Controlled (Definite) Repetition
Creating and Using Pointer Variables in C++ By: Ed Brunjes
More Loops Topics Counter-Controlled (Definite) Repetition
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.
More Loops Topics Relational Operators Logical Operators for Loops.
National Chiao Tung University
More Loops Topics Counter-Controlled (Definite) Repetition
CSCE 206 Lab Structured Programming in C
CSCE 206 Lab Structured Programming in C
Introduction to C Programming
EECE.2160 ECE Application Programming
More Loops Topics Counter-Controlled (Definite) Repetition
Presentation transcript:

Homework 2 (due:May 13th) Deadline : May 11th 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#.hw2”. (ex) 20111499.hw2 We have three problems in hw2. Make four C source files. The name of the source files should be the format “studentID#.hw2.#.c” (ex) 20111499.hw2.1.c , 20111499.hw2.2.c , …, 20111499.hw2.4.c In each source file .c, your code must have comments that include your name and student_id# Put the 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) 20111499.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.

Input example output example  64+16+8+2+1 1.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 <stdio.h> int main() { int B; // you may declare variables here scanf(“%d”,&B); // put your code here return 0; } Input example 01011011 output example 91  64+16+8+2+1

Input example  64+16+8+2+1 output example 2.Input a (decimal) integer value N and print its equivalent binary value containing 8 digits of only 0 and 1. Assume 0<=N<=255. #include <stdio.h> int main() { int N; // you may declare variables here scanf(“%d”,&N); // put your code here return 0; } Input example 91  64+16+8+2+1 output example 01011011

Input example output example 3. 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 <stdio.h> 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 3:*** 15:*************** 8:********

Input example output example Input example output example 4. Korean Gymnastic Association is trying to modify the scoring system in order to improve its fairness. In the previous system, each of 5 judges gives a score from 1 to 10. The sum of the scores except the maximum and the minimum score becomes the final total score. To improve the previous system, we first remove the maximum and minimum scores out of the 5 scores. Then, if the difference between the maximum and the minimum scores out of the remaining 3 scores is 4 or more, the scores need to be re-evaluated. Write a program that takes 5 scores as an input and print the total score. If the score needs to be re-evaluated, print KIN (Keep In Negotiation). Input example 10 8 5 7 9 output example 24 Input example 10 3 5 9 10 output example KIN