Difference between revisions of "IAG0582 - Programming II"

From ATI public wiki
Jump to: navigation, search
(Database homework)
((by SublimeText.Mediawiker))
Line 77: Line 77:
  
 
Finished homework should be sent to '''hkinks@ati.ttu.ee'''
 
Finished homework should be sent to '''hkinks@ati.ttu.ee'''
 +
 +
===Compiling code with PostgreSQL library===
 +
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.
 +
[http://mini.li.ttu.ee/~priit/IAY0340.2013/ssh_setup/putty_guide.html 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, as the correct library directories have to be linked and dependencies resolves.
 +
For more information you can visit http://www.postgresql.org/docs/9.1/static/libpq.html and for downloading the libraries with postgresql itself: http://www.postgresql.org/download/ .
  
 
===Helping materials===
 
===Helping materials===
Line 84: Line 91:
 
===C sample===
 
===C sample===
 
[http://ati.ttu.ee/~hkinks/iag0582/praktikum11/psql.c Sample] - Creates a connection with a database and queries 10 first rows.
 
[http://ati.ttu.ee/~hkinks/iag0582/praktikum11/psql.c Sample] - Creates a connection with a database and queries 10 first rows.
 
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.
 
 
[http://mini.li.ttu.ee/~priit/IAY0340.2013/ssh_setup/putty_guide.html 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, as the correct library directories have to be linked.
 
For more information you can visit http://www.postgresql.org/docs/9.1/static/libpq.html and for downloading the libraries with postgresql itself: http://www.postgresql.org/download/ .
 

Revision as of 00:06, 17 May 2016

Eesti keelne leht Estonia.png

General Information

Tests

I test 5. week files and structs 25 points
II test 12. week dynamic memory allocation 25 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 40 points from practice classes

  • 1p for participation (total can be maximum of 14p)
  • practice class tasks up to 26p, 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 71p 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 hkinks@ati.ttu.ee

Compiling code with PostgreSQL library

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, as the correct library directories have to be linked and dependencies resolves. For more information you can visit http://www.postgresql.org/docs/9.1/static/libpq.html and for downloading the libraries with postgresql itself: http://www.postgresql.org/download/ .

Helping materials

C sample

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