Microsoft Imagine All KU students currently enrolled in a CS class are eligible to receive Microsoft software, including Operating Systems development tools some application software Does not include MS Office Find more information from http://www.kutztown.edu/academics/colleges-and-departments/liberal-arts-and-sciences/departments/computer-science-and-information-technology/student-resources.htm
GA office hours Graduate Assistants in GA Office (OM 255) Fall 2017 Hours Mon-Thur 9:00am – 6:00pm Fri 9:00am – 3:00pm Feel free to come and ask questions about 135 assignments
Putty You can download Putty (on Windows) from http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe Download it to desktop or any folder you like Standalone program, no need to install Double click to run To configure Putty (?) http://cs.kutztown.edu/resources/UnixWorkshop/index.html
Computer Hardware
Computer hardware CPU (Central Processing Unit) Main memory: fast access, temporary storage, smaller capacity RAM (Random Access Memory) Secondary memory: slow access, permanent storage, larger capacity Hard disc, flash drive, CD
Random Access Memory Know difference between Random access content of a memory location address of a memory location Random access Given the address of a memory location Can access the location in one clock cycle Regardless of the location accessed in previous cycle Random access vs. Sequential access DVD vs. Video tape
Input/Output (I/0) devices Input devices Keyboard, mouse, scanner, video cam, microphone Output devices Monitor, speaker, printer
Computer Programs A set of instructions (like a recipe) Two kinds of programming languages Low-level language or Machine language 1011010000000101 High-level language (more human readable) C++, Java, etc.
Compiler A computer program Example Process translates a program in high-level language into a program in machine language Example Process g++ hello.cpp a.out
Common elements of C++ language Keywords Reserved words (~two dozen) Programmer-Defined Identifiers Variable, function Operators Arithmetic operators, logical operators
Common elements of C++ language Syntax Grammar, rules that must be followed Learn to be detail-oriented Comments or Documentation Must follow the department’s standard http://cs.kutztown.edu/pdfs/Documentation_Standard.pdf
A sample program 1 // This program calculates the user's pay. 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 double hours, rate, pay; 8 9 // Get the number of hours worked. 10 cout << "How many hours did you work? "; 11 cin >> hours; 12 13 // Get the hourly pay rate. 14 cout << "How much do you get paid per hour? "; 15 cin >> rate; 16 17 // Calculate the pay. 18 pay = hours * rate; 19 20 // Display the pay. 21 cout << "You have earned $" << pay << endl; 22 return 0; 23 }
Key Words 1 // This program calculates the user's pay. 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 double hours, rate, pay; 8 9 // Get the number of hours worked. 10 cout << "How many hours did you work? "; 11 cin >> hours; 12 13 // Get the hourly pay rate. 14 cout << "How much do you get paid per hour? "; 15 cin >> rate; 16 17 // Calculate the pay. 18 pay = hours * rate; 19 20 // Display the pay. 21 cout << "You have earned $" << pay << endl; 22 return 0; 23 } Refer to Page 60
Programmer-Defined dentifiers 1 // This program calculates the user's pay. 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 double hours, rate, pay; 8 9 // Get the number of hours worked. 10 cout << "How many hours did you work? "; 11 cin >> hours; 12 13 // Get the hourly pay rate. 14 cout << "How much do you get paid per hour? "; 15 cin >> rate; 16 17 // Calculate the pay. 18 pay = hours * rate; 19 20 // Display the pay. 21 cout << "You have earned $" << pay << endl; 22 return 0; 23 }
Operators 1 // This program calculates the user's pay. 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 double hours, rate, pay; 8 9 // Get the number of hours worked. 10 cout << "How many hours did you work? "; 11 cin >> hours; 12 13 // Get the hourly pay rate. 14 cout << "How much do you get paid per hour? "; 15 cin >> rate; 16 17 // Calculate the pay. 18 pay = hours * rate; 19 20 // Display the pay. 21 cout << "You have earned $" << pay << endl; 22 return 0; 23 }
Punctuation 1 // This program calculates the user's pay. 2 #include <iostream> 3 using namespace std; 4 5 int main() 6 { 7 double hours, rate, pay; 8 9 // Get the number of hours worked. 10 cout << "How many hours did you work? "; 11 cin >> hours; 12 13 // Get the hourly pay rate. 14 cout << "How much do you get paid per hour? "; 15 cin >> rate; 16 17 // Calculate the pay. 18 pay = hours * rate; 19 20 // Display the pay. 21 cout << "You have earned $" << pay << endl; 22 return 0; 23 }
Summary Computer hardware Programming language CPU, RAM, Secondary memory, I/O Programming language Machine language, high-level language, compiler Basic components of a C++ program Keywords, programmer-defined ID, punctuation, operators, syntax, comments