Difference between revisions of "IAG0582 - Programming II"

From ATI public wiki
Jump to: navigation, search
(HW3)
(zoom0505)
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
=General Information=
 
=General Information=
 
[http://pld.ttu.ee/~trkal/Download%20PuTTY.pdf How to access your P drive from home and how to remotely compile code in school computers]<br />
 
[http://pld.ttu.ee/~trkal/Download%20PuTTY.pdf How to access your P drive from home and how to remotely compile code in school computers]<br />
 +
Your username is your UNI-ID '''without''' the domain (@ttu.ee or @taltech.ee etc). Your password is invisible, just write it and press ENTER.<br />
  
 
[https://docs.google.com/spreadsheets/d/10XYmGs3TF9rCSYVsmE1ewDG-HixHFsq-Un6WvyvPSXY/edit?usp=sharing Results]<br />
 
[https://docs.google.com/spreadsheets/d/10XYmGs3TF9rCSYVsmE1ewDG-HixHFsq-Un6WvyvPSXY/edit?usp=sharing Results]<br />
 
[https://docs.google.com/document/d/1uFQgAoKpQ_KS2JWnZgwGb_ZpC7U-MXXXJNs-WMCwaXo/edit?usp=sharing Programming resources]<br />
 
[https://docs.google.com/document/d/1uFQgAoKpQ_KS2JWnZgwGb_ZpC7U-MXXXJNs-WMCwaXo/edit?usp=sharing Programming resources]<br />
 +
[https://us04web.zoom.us/j/72639468399?pwd=bVFlQzMrUk1GRi9pM2hVcUp6Z1gzZz09 Test 2 Zoom room, reopened. ]<br />
 +
[http://pld.ttu.ee/~trkal/E/test%202.pdf Test 2, will be uploaded at 11:30]<br />
 +
[https://docs.google.com/document/d/1qfV3LKe8fIb_Tlc5J2N95bXf3xWHZOvHA63gNdmXI9M/edit?usp=sharing Exam - please register only when you have submited both homeworks]<br />
  
  
Line 17: Line 21:
 
[https://echo360.org.uk/media/dd76f7f0-a1e1-4b8f-9813-76e9a40d4d98/public Introduction to HomeWork II]<br />
 
[https://echo360.org.uk/media/dd76f7f0-a1e1-4b8f-9813-76e9a40d4d98/public Introduction to HomeWork II]<br />
 
[http://pld.ttu.ee/~trkal/E/Exercise%2031.03.pdf Exercise 31.03]<br />
 
[http://pld.ttu.ee/~trkal/E/Exercise%2031.03.pdf Exercise 31.03]<br />
[https://echo360.org.uk/media/c250b333-a223-4e47-a994-a787423ee8ef/public%20-%20putty%20eng How to access school computer remotely and how to do homework 3]<br />
+
[https://echo360.org.uk/media/c250b333-a223-4e47-a994-a787423ee8ef/public How to access school computer remotely and how to do homework 3]<br />
 
[http://pld.ttu.ee/~trkal/E/Homework%203.pdf Homework 3]<br />
 
[http://pld.ttu.ee/~trkal/E/Homework%203.pdf Homework 3]<br />
 +
 +
[https://echo360.org.uk/media/4e8955dc-f0be-40d0-b75c-f8269d762bdf/public 21.04.2020 12.00 Test 2 Overview]<br />
 +
Tests with incorrectly chosen versions will not be graded.<br />
 +
[https://echo360.org.uk/media/f7ea306a-fb02-4aa2-9e5f-764f4787f5b5/public Exercise 28.04]<br />
 +
[http://pld.ttu.ee/~trkal/E/ss%20eng.pdf Slide show about debugging and exceptions]<br />
 +
[https://us04web.zoom.us/j/79678822669?pwd=SVc4a1dUcVkraTlkRW1PeEJxU0phZz09 Zoom for 05.05, opens 12:00]<br />
 +
 +
 +
  
 
All codes have to be sent to trkal@ati.ttu.ee and vladimir.viies@gmail.com
 
All codes have to be sent to trkal@ati.ttu.ee and vladimir.viies@gmail.com

Latest revision as of 08:46, 5 May 2020

Eesti keelne leht Estonia.png

General Information

How to access your P drive from home and how to remotely compile code in school computers
Your username is your UNI-ID without the domain (@ttu.ee or @taltech.ee etc). Your password is invisible, just write it and press ENTER.

Results
Programming resources
Test 2 Zoom room, reopened.
Test 2, will be uploaded at 11:30
Exam - please register only when you have submited both homeworks


HW2 version is chosen by the last digit in your student code
Link to homework2

E-studies

All homeworks are individual works and while learning programming in groups is allowed, sending 2 identical works is not allowed

Exercise for 17.03.2020 lesson
Short explanation 24.03
Exercise for 24.03 lesson
Introduction to HomeWork II
Exercise 31.03
How to access school computer remotely and how to do homework 3
Homework 3

21.04.2020 12.00 Test 2 Overview
Tests with incorrectly chosen versions will not be graded.
Exercise 28.04
Slide show about debugging and exceptions
Zoom for 05.05, opens 12:00



All codes have to be sent to trkal@ati.ttu.ee and vladimir.viies@gmail.com

Tests

I test 5. week files and structs 20 points
II test 12. week dynamic memory allocation 20 points

Homeworks

I homework files and structs 15 points
II homework dynamic memory allocation 15 points
III homework optional 10 points
Database task
Microcontroller task

First two homeworks must be done before thursday of 16. week. Third homework's deadline is until the end of the semester.

If there is a suspicion of plagiarism for any submitted work of student, the grade for that submission will be 0 points. To improve the score, the submission must be defended.

Practice classes

It is possible to gather up to 36 points from practice classes

  • 1p for participation (total can be maximum of 14p)
  • practice class tasks up to 22, from which 4p will be from guest practice classes:
    • Database task 2p
    • Microcontroller task 2p

More information about the practice classes can be found on your practice class teacher's homepage

Requirements for exam

  1. Pre-exam requirement is 61p before the start of exam session
  2. Exam requirement is 50p ( practice + test I + test 2 + bonus )

Exam

Exam's grade is the result of the following points:

Homework I + homework II + homework III + written examination (max 65p)

3. Homework

Database homework

  • There has been given a PostgreSQL database, which consists of a simple student information system data.
  • To take the task, you first have to register with your student code. This is necessary for creating an user for you and an user specific database, which has been filled with sample structure and data. You will have rights to insert, modify and delete rows in your database and feel free to do so.
Registration
  • Connection parameters:
Host: ewis.pld.ttu.ee
Database: <student code>
Port: 5432
User: <student code>
Password: <password you chose during registration>
  • For managing the database, you can use some of postgre database clients, like:
  • Data structure has been given with the image

Is struct.png

  • If there is a need to reset the initial database, you can use the following SQL statements for that - Link

Tasks

Create a text based user interface program, that would have the following functionality:

  1. Adding a student. User will be asked: first name, last name, date of birth. Program has to generate unique student code for each student. (2p)
  2. Modifying and deleting a student. (2p)
  3. Adding, modifying and deleting a course. (2p)
  4. Giving grade for a student for a specific course. When inserting a grade, the average grade should also be updated taking account the credit points. (2p)
  5. Searching students based on their weighted average grade. (2p) For example, if we want to find the best students we could specify condition 'avg > 4.6'

Program has to communicate with the given database and use it for reading and storing data.

Finished homework should be sent to raiko.keinanen@gmail.com

Compiling code with PostgreSQL library

To connect the PostgreSQL database within your C code, you have to have the connector libraries installed and the compiler has to know where to find them.

The easiest way to compile your program is using TUT's lab computers, where PostgreSQL is previously installed and the library can be easily included. Guide for connecting to lab computers over SSH

It is of course possible to install the PostgreSQL C libraries also on your own computer independent of your OS, but this can be time consuming on the first try.

For more information about setting it up yourself, you can see PostgreSQL setup

When compiling, you should include the header file in your C code:

#include <pgsql/libpg-fe.h>

Keep in mind that the location could be different if you choose to compile it from your own computer.

While compiling you should also give the linker argument -lpq. For example gcc -o program main.c -lpq.

Helping materials

C sample

Sample - Creates a connection with a database and queries 10 first rows.