Course title, code: Programming 1, GAINBAN-PROGRAM1-1
The aim of the course Programming 1 is to familiarize students with the basics of the C and C++ programming languages and to enable them to develop simple programs independently. Furthermore, students will learn the steps and basic techniques of software development using the C and C++ languages.
1. Requirements. Development environments. Structure of C++ programs. 2. Basic input - output commands, elementary data types of the language. 3. Arithmetic, logical and relational operators. Sequence of operations. Type conversions. 4. Control structures: branches, loops 5. Arrays, multidimensional arrays. 6. Written test 1 7. Strings, character arrays. 8. Structure type, structure arrays. 9. Pointer and reference types. 10. Written test 2 11. Functions. 12. Reading and writing text files. 13. Make-up/replacement written test.
Course content - labs:
1. Source code structure, header file, namespace, main function, cin, cout, declaring and using numerical variables (int and double), conditional statement. degree2radian: Convert angle expressed in degrees into radians. triangle: Determine from 3 side lengths whether they can form a triangle by applying the triangle inequality theorem. 2. Using Visual Studio, controlled input using do-while loop, problem of integer division Sphere: Calculate the volume of a sphere knowing the radius. QuadraticEquation: Determine the roots of a quadratic equation. 3. Using the switch-case conditional statement, problem of integer division, nested if-else statements, do-while loop. BasicOperations: Create a simple calculator that performs operations using the switch-case statement. GradingScheme: Determine the grades from the number of achieved points. 4. Random number generation, one-dimensional array, using prefix and postfix operators, for loop, sum and average calculation, problem of integer division. RandomNumbers: Create an array of int values, populate it with random numbers, calculate the sum and the average of the numbers. 5. Swapping the content of two variables, sorting the content of an array. Sorting: Fill an array with random numbers and sort the array in ascending order using the bubble sort algorithm. 6. Using the struct type, initialization, console input, while loop. Using apostrophes as separators in literals and string operations. Movies: Declare a struct type that is able to store some information related to a movie (title, director, first two actors from the cast list, year of release, lifetime gross in USD. Declare three variables of type Movie with initialization. Display the information about the first movie in a tabular format. Display the value of Lifetime gross with commas as thousands separators, e.g. 2,920,357,254. Define a loop that iterates backwards in the string with a step of 3. Insert a comma into the string in each iteration. Individual work: display the send and the third movie in a similar mode. 7. Written test 1 8. Console input, text containing whitespace characters. Comparison of two character arrays. Capitalize text. Using automatic variable type. NameInput_CharArray.cpp: Read from the console two names, i.e. the first one using cin, and the second one using cin.getline(). Compare the results. Capitalize them. 9. Two dimensional array, random numbers, conditional statement, finding the location of the smallest value. CardGame.cpp. 10. Array of structures created with initialization, saving data to a text file, reading data from a text file, dynamic memory allocation, accessing array elements and structure fields through a pointer. StructArrayFile.cpp. 11. Written test 2 12. Written test for replacement/correction. 13. Complex program.
Knowledge:
- He knows the vocabulary and special terms of the engineering profession in the Hungarian and English languages at least on the basic level.
He/she can apply his/her knowledge acquired during his/her study to acquire deeper knowledge in the field of information engineering and to process special literature and solve problems related to information technology.
- He/she is open to acquire new methods, programming languages and develop skills to use them.
Mid-term study requirements:
To receive a course grade, it is mandatory to complete the online Moodle courses prepared for the subject. For each quiz included in these courses, a minimum score of 50% must be achieved. Besides, there will be two written tests during lecture classes and two written tests during lab classes. Each written test will contribute 25% to the final grade.
Exam requirements:
Lecture notes.
A. Pásztor, Z.C. Johanyák: Basics of the C++ programming language, available in the TEAMS group of the course
C++ Programming by Wikibooks, https://upload.wikimedia.org/wikipedia/commons/4/4b/C++_Programming2008-4-18.pdf Stroustrup, Bjarne: The C++ Programming Language (4th Edition), Addison-Wesley, 2013