Course info

STRUCTURE OF THE PROGRAM (CCTU CODING FOR EXCELLENCE)
The basic programing languages consist of C, C++, and C#. The three languages will be treated together as one full course. The full course will take three weeks to complete and one extra week for students to Lab discussions, presentations of group projects and individual projects for graduation.
FIRST MODERN PROGRAMMING LANGUAGE ( C )/C++/C#
Course Description
C is a general purpose high-level language that was originally developed to develop the UNIX Operating System at bell Labs. Most of the new languages such as C++, C#, Python, Pearl, and Java, evolved from C and the C language is widely used professionally for various reasons:
· Easy to Learn
· Structured language
· It produces efficient programs
· It can be compiled on a variety of computer platforms
· It can handle low-level activities
Why is C Popular and still widely used?
Students without any Computer programming background or experience can learn C programming language with ease from the basic foundation. The students will have a strong foundation in computer coding and development of control systems that will lead them to a higher level development expertise.
C was initially used for system development, programming devices, such as car dashboards, speedometer boards seen in our modern cars. The language is used also to develop software applications. So before you get yourself wet in software programming or Software Engineering you have to learn C.
C is used to develop
· Operating Systems (windows 10, Linux, and Unix OS)
· Assemblers
· Text Editors
· Print spoolers (HP printers, Dell photo copiers, Sonny vinyl cutting machine )
· Network Drivers (StarCom,)
· Modern Programs
· Databases
· Language Interpreters
· Utilities
· Engineering components Devices
Objectives of the Course
The students upon completing this course will be able to write programs that will be embedded in Robots to weed a farm and perform different functions. They will be able to think logically and adopt critical reasoning to develop any software engineering design projects and develop applications.
We will assemble a little robot as an experiment to show to students how powerful the language can help developers in developing hardware devices. Students will get the basis of coding that will enable them to learn higher languages that are more graphical and object oriented Programming.
Course Outline, Lecture Notes for both Classroom and Online Teaching
Topic 1 /Day 1- 1:45 mins
· Introduction of C
· Identifiers and Keywords that makes the C language.
· Here you will learn keywords that are reserved in C programming that are part of the programming Syntax.
E.g. 32 keywords :
Float, int, char, etc. will be fully explored.
Identifiers are Character set, Alphabets, Digits and storage.
Special Characters and White space will be treated.
Note: C accepts both lower case and upper case characters and variables names.
· Arithmetic Operators will be touched briefly
e.g. +,-,/,%, and *.
· Variables, Constants , and Data Types
· Every Variable is a memory location and storage of data in the memory with specific memory addresses assigned to the names of the variables.
· Naming conversion of Variables with do and don’t will be covered
· Input and Output, preprocessors and C libraries will be covered extensively. Every C language program starts by loading pre-processors and libraries in the memory first before the compiler can convert the higher level language into machine readable code of 0’s and 1’s.
The structure of the C language will be explored;
Every C language starts with the following Structure:
#include<stdio.h>
#include<string.h>
#include<time.h>
The stdio.h library contains about 90% of the other C libraries. When the <stdio.h> is loaded in the memory, it allows the C program to run.
Libraries are pre-written programs that allow the C programs to perform certain specific functions.
E.g. math.h allows the program to perform mathematical calculations that demands higher computational powers.
The declaration part of the C language structure consists of functions and constants that are pre-defined.
#include<stdio.h>
#include<math.h>
/* Declaration part */ = comments
#define LENGTH 20
#define WIDTH 5
const 30
int cal( int c, int b)
int main()
{
/* Here you write your code */
Int Area;
Area = LENGTH * WIDTH;
printf( “ The area of the object is %d\n”, Area);
return 0;
}
One main function
int main (int c, double b, char c)
{
Here you define your variables
int c=10; float dec = 20.56; char a = ‘D’;
Codes to be executed
Return 0;
}
Rules of Naming Variables and how storage of data are defined.
· C operators
· Learn about different type of operators
Excises1. Write a program that will take an input of different type of numbers, compute the results and output or display the result on the screen.
Excises2. Write a program That takes your name and write your name on the screen in reverse
TOPIC 2/DAY TWO 1:45 mins
How do we get the machine to make intelligence decisions? This section is very important for students to develop logical thinking through the use of Flow Control System
The class will cover C Flow Control and Decision Making
· If—else
· Conditional clause ?
· for loop
· while loop
· do—while loops
· switch---case flow control
· break and continue
· programming goto flow control
· Iteration
· Example of flow control
If (test passes the condition)
{
// expression in the brackets get executed
}
If (text expression evaluates true)
{ // expression in the expression get executed
}
else { if expression evaluates to be false then the second statement get executed
}
· For (i=0; i>10; i+1;)
· While loop
· do------while loops
· Assignments and practice of decision making
1. Write a program that takes an integer. The program evaluates the intake value to define set of range values declared in the program. if it is true or not. If true the program tells user congratulation and write the value out, and if false tells the user try again.
2. Write a program that tells a robot if it detects the presence of an object within the sensor parameter, it should lift its arm.
3. Computer Lab experiments
Topic 3/Day 3 Times 1:45mins
· Functions are block of code that perform specific Task
· User defined functions will be explored
· Function Prototype
· Functions are called
· Passing arguments to a function
· Built-in Functions such strcat(), and memcyp()
Structure of a function:
Return type name (parameter1, int c, double b)
{
Function definition is the actual body of the function
#include<stdio.h>
#include<math.h>
/* declare your function here */
double calculus ( int c, double b)
int main()
{
Int c; double b;
Printf(“ Enter two numbers with space b/w them, one whole number and another decimal : “);
Scanf(“%d %f “, &c, &b);
Calculus (int c, double b);
Printf( “ The solution for the calculation is %2.4f\n”, results);
return 0;
}
double calculus (int c, double b)
{
double results = c*b;
return results;
}
Topic 4/Day4 2:00 hrs.
· Arrays will be treated
· All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.
·
· Declaring Arrays and two dimensional arrays.
· To declare an array in C, a programmer specifies the type of the elements and the number of elements required by an array as follows –
· Class Exercise. Write a program that takes 100 ticket numbers from patients at interberton Hospital. The system looks through the hospital database and check for the names of the patients. If the patient exists, the program will look at the patients lined up and mention the patient’s name. If the patient name does not exist in the hospitals database, the program asks the patient to go to OPD for a new Card.
This program will help to shorten the lined up time at our hospitals in Ghana.
· Pointers are powerful features in C, C++, C#, and other programming languages. Pointers are storage variables that contain the memory addresses of other variables.
Note: pointers don’t store value but only memory addresses that store the real values.
Declaration of Pointers
Int *ppt;
Float *float;
Char *char;
With the help of pointers in C language, search engines such as google, yahoo, and Lycos were developed.
· Strings are sequence of Character that ends with a null \0 character char[3]= {“A”, “B”, “C”};
STRUCTURES
· Structures is a collection of variables that are of the same datatype
Examples struct robot
{
Char name[30] ={“ Farmer”};
int height =30;
int width = 20;
int Rarm =10;
int Larm = 10;
} GhanaFarmer;
Declaration of UNIONS
· Unions are another datatype storage that allows members of the program to store data in the same memory location.
Union data
{ inti l; float f; char name[20];} person1, person2;
How do you access the members of the Union Dataype?
int main()
{
Union data person;
Person.l =20;
person.f = 30.89;
person.name = {“ Anthony Ardiabah”};
printf(“ write out the first member %d\n”, person.l};
return 0;
}
· Bit-fields
· struct {
· unsigned int widthValidated;
· unsigned int heightValidated;
· } status1;
· Stuct {
· Unsigned int withValidated : 1;
· Unsigned int heightValidated : 1;
· }status2;
· Typedef
The C programming language provides a keyword called typedef, which you can use to give a type a new name. Following is an example to define a term BYTE for one-byte numbers −
· typedef unsigned char BYTE;
· Files accessibility: C programmers can create, open, and close text or binary files for their data storage.
FILE * , fopen(), fclose(); reading of files will be accessed.
Topic 5/Day5 3:00 hrs
Computer Lab Assignments and Excises
Students will solve real world problems by using the concepts learnt above. More emphasis will be based upon application of new modern programing Techniques. Error handling and both C++ will be treated since most of the syntax is the same as C.
Topic 6/Day5 3:00 hrs
Computer Lab Projects
1. Building the Robot called GhanaFarmer.
2. Developing a program that Solves over crowed Hospitals by patients in Ghana.
3. Covid-19 Project. Students will develop an application that can be downloaded unto smart phones. The application will take peoples temperature at home when they wake up with the help of the scanner app in the smart phones and Tablets. If your Temperature is above 38, the application will advise you don’t go out, stay home or seek medical attention. The application will avoid contacts in the markets, and public places. It will also reduce the spread of the Virus in Ghana and the world.
Topic 7/Day 7 3:00 Lab
Computer Lab Projects
Students will be assigned an individual project to be presented at the end of the course. C++ and C# will be introduced. The class will work on the differences between C and C++. C# is an object oriented Programming will commence. C# will also take the same format as C for seven days intensive programming.
Programming in C#.
Course Description:
This course provides the beginning programmer with a guide to developing programs in C#. C# is a language developed by the Microsoft Corporation as part of the .NET Framework and Visual Studio platform. The .NET Framework contains a wealth of libraries for developing applications for the Windows family of operating systems.
With C#, you can build small, reusable components that are well-suited to Web-based programming applications. Although similar to Java and C++, many features of C# make it easier to learn and ideal for the beginning programmer. You can program in C# using a simple text editor and the command prompt, or you can manipulate program components using Visual Studio’s sophisticated Integrated Development Environment. This course provides you with the tools to use both techniques.
Course Outline
1. A First Program Using C#
2. Using Data
3. Using GUI Objects and the Visual Studio IDE
4. Making Decisions
5. Looping
6. Using Arrays
7. Using Methods
8. Advanced Method Concepts
9. Using Classes and Objects
10. Introduction to Inheritance
11. Exception Handling
12. Using Controls
13. Handling Events
14. Files and Streams
A. Program Information: Program Outcomes, Sequence, Prerequisites, Post-requisites
This course assumes that you have little or no programming experience. The examples used in this course are business examples; they do not assume mathematical background beyond high school business math.
B. Course Outcomes
1. Understand the language by creating working C# programs using both the simple command line and the Visual Studio environment
2. Learn about data and how to input, store, and output data in C#
3. Create GUI applications
4. Explore classic programming structures—making decisions, looping, and manipulating arrays—and how to implement them in C#
5. Provide a thorough study of methods, including passing parameters into and out of methods and overloading them
6. Understand object-oriented concepts of inheritance and exception
7. Learn how to save data to and retrieve data from files
Last Computer Lab Class
· Discussion of Computer Lab projects.
· Individual presentations.
· Group presentations.
· Final Submission of Projects.
· Ending of C/C++, and C# course classes.
- Manager: Anthony Ardiabah
- Manager: Williams Obinkyereh
- Student: Anthony Anthony
- Student: James Apenuvor
- Student: Kwabena Bempong kurankye
- Student: Ernestina Bonney.
- Student: Grace Bosompem
- Student: Philia Hammond
- Student: Herbert Menlandede
- Student: Cyprain Mensah
- Student: Theophilus Munkoh
- Student: Duti Naan
- Student: Isaac Nortey
- Student: Richard Obeng Poku
- Student: Dr Henry Quarshie
- Student: Raphael Sanzah