0% found this document useful (0 votes)
7 views

Computer Programming Assignment 1 Leeman Sithole

The document contains assignments for computer programming courses. The first assignment asks students to write programs to convert decimal to binary, check for a leap year, and simulate an ATM. The second assignment requires students to write a basic calculator program using functions and switch statements.

Uploaded by

Black Flame
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Computer Programming Assignment 1 Leeman Sithole

The document contains assignments for computer programming courses. The first assignment asks students to write programs to convert decimal to binary, check for a leap year, and simulate an ATM. The second assignment requires students to write a basic calculator program using functions and switch statements.

Uploaded by

Black Flame
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

ZQMS-ARC-REC-002

ASSIGNMENT COVER

REGION: _________________HARARE_____________________________________________

PROGRAM: __BACHELOR of SCIENCE IN SOFTWARE ENGINEERING


HONORS________INTAKE: _1_________

FULL NAME OF STUDENT: __LEEMAN SITHOLE L______PIN:__P2342171C__

MAILING ADDRESS:__blackflame922@gmail.com_____________________________________

CONTACT TELEPHONE/CELL: __0786619742________________ ID. NO.: _63-2325662B13___

COURSE NAME: _COMPUTER PROGRAMMING____ COURSE CODE: _BSIT131______

ASSIGNMENT NO. e.g. 1 or 2: __________1_____________ DUE DATE: ______________

ASSIGNMENT TITLE:
_________________________________________________________________________________

_________________________________________________________________________________

______________________________________________________________________________

MARKER’S COMMENTS: ______________________________________________________

______________________________________________________________________________

OVERALL MARK: _____________ MARKER’S NAME: ________________________

MARKER’S SIGNATURE: _______________________________ DATE: ___________


1) Education 5.0 and the role of computer programming in education 5.0.

The education 5.0 is a policy that has been billed as important policy instrument aimed at
transforming the Zimbabwean society in particular through universities.

Education 5.0 by their nature and character are better positioned to grasp and decipher the
threatening disruptive technologies such as IoT (Internet of Things), advanced robotics, and
automation of knowledge work that continue to dramatically reshape the global businesses
and social landscape. (Enoch Jonathan).

According to this policy, a state subscribed is to immediately operate in the industry solution
provider (ISP) mode. Programming is what is mostly used to design the programs that are
used to decipher the problems and create the solution of the problems for example A.I
programs that aid the worker with more difficult equations that the simple mind cannot
decipher.

This model is aimed at improving the country`s economy using technological advancements
that are brought up by the various universities who have adopted the education 5.0 module or
system.

It is meant to advance the isolated technology in Zimbabwe and the country has adopted it to
retool and revive industry using the latest technology.

2) Write a c program to convert Decimal to binary.

Step 1: start

Step 2: Declare the decimal, binary and middle

Step 3: Create a loop to print and read the number from the user

Step 4: if (decimal<0) this is to see the non- negative number

Step 5: to read the middle of the number so that it can be arranged in the right way.

Step 6: print the binary number from bottom up and print output.
3) Write a program to see if the year is a leap year or not.

Step 1: Start by declaring Boolean and adding the library.

Step 2: Take input of year from user and check if the year is divisible by 4

i) If (year is divisible by 4) then print(it is a leap year)


ii) Else if(year is not divisible by 100) print(it is a leap)
iii) Else(it is a leap year)

Step 4: loop several years to print out the year that is a leap year.

i) For example it is going to take years from 1900 to 2100 and determine if it is a
leap year or not (for (int y=1900; y<2100; y++)).

Step 5: End
4) Write a program that mimic how an ATM works

Step 1: start

Step 2: declare the variables that are used, phone, balance, withdrawal, deposit, password,
account, create account, and amount

Step 3: Take input from user using the opt variable and store it in the opt variable.

Step 4: use FILE*fp to open files and save the account that you have created

Step 5: use the switch statement to choose your option

Step 6: Display the menu after the validation of correct password and phone number recorded
in the phone.dat file,

i) Quit and proceed are there as options and it is looping.


ii) After that you can see the balance and transfer the amounts to another account.

Step 7: End the program.


5) A simple calculator to add, subtract, multiply, divide numbers using the switch statement.
Step 1: Start
Step 2: Use the void function to define add, subtract, multiplication and divide.
Step 3: use the switch statement to take option from the user and select.
Step 4: each case can call the void function according to the user`s option of operation.
Step 5: after being called the function displays the menu and the n the user is given
option to enter the numbers and perform an arithmetic operation.
Step 6: the program displays the answer and then the program ends.

You might also like