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

Regent University College: C++ Assignment

This document contains an assignment submitted by Augustina Adobea Amponsah for a C++ course at Regent University College. The assignment contains 4 questions on object-oriented programming concepts like objects, classes, encapsulation and abstraction. It also includes 2 C++ programs, one to calculate the average of 3 numbers input from the keyboard and another to convert a temperature from Celsius to Fahrenheit. The student provides explanations of object-oriented programming terms and the code for the 2 programs to answer the questions posed by the assignment.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Regent University College: C++ Assignment

This document contains an assignment submitted by Augustina Adobea Amponsah for a C++ course at Regent University College. The assignment contains 4 questions on object-oriented programming concepts like objects, classes, encapsulation and abstraction. It also includes 2 C++ programs, one to calculate the average of 3 numbers input from the keyboard and another to convert a temperature from Celsius to Fahrenheit. The student provides explanations of object-oriented programming terms and the code for the 2 programs to answer the questions posed by the assignment.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

REGENT UNIVERSITY

COLLEGE

C++
ASSIGNMENT

PRESENTED BY: AUGUSTINA ADOBEA AMPONSAH


COURSE: BSC MANAGEMENT WITH
COMPUTING
(MARKETING)
ID: 2500208
LEVEL: SASS LEVEL 300 (WEEKEND
STREAM)

26/10/2009
LECTURER’S NAME: Mr David Botwe
Questions

1. what is Object Oriented Programming

2. define the following


a. object
b. class
c. encapsulation
d. abstraction

3. write a c++ program to find the average of three floating point


numbers the numbers should be read from the keyboard

4. write a program that accepts a temperature in degree Celsius


and convert to Fahrenheit using the following formula
Fahrenheit (9/5) +Celsius +32

Answers

1. Object Oriented Programming

It is a programming language model organized around objects


rather than actions and data rather than logic or is a method of
implementation in which programs are organized as collection of
objects, each of which represent an instance of classes.

2. (a) Object

Is a collection of related data and codes use in Object


Oriented
Programming.

(b) Class

Is a fixed number of data (or variables) and functions, called


members of the class or the attributes and behaviour of an
object.

(c) Abstraction

It is process of managing complexities of a big task into


workable objects.
(e) Encapsulation

Is the process of abstraction by hiding details that are not


necessary to any other objects

3. # include <Iostream>

Using namespace std;

Int main ( ){

Float sum; float average

Float num, 1, 2, 3; 11 variable declarations

Cout << “enter first number”;

Cin >> num 1;

Cout << “enter second number”;

Cin >> num 2;

Cout << “enter third number”;

Cin >> num 3;

Sum = num 1 + num 2 + num 3;

Float average = sum/3;

Cout << “the average of the three number is<<average

Return 0;

4. Int main ( )};

Float temperature;

Float Fahrenheit;

Cout <<”enter temperature in Celsius” end;


Cin >> temperature;

Fahrenheit = 1.8 * temperature + 32;

Cout << the temperature in Fahrenheit s:<< Fahrenheit;

Return 0;

In my previous career my biggest contribution was my ability to accurately measure


customer satisfaction and to continually feed this information back to our sales department. I
personally spent 10% of my time talking to customers and selling of our products. This attention
to customer satisfaction is relevant in your industry as well. I look forward to adopting my quality
program to a new type of product. I will also increase efficiency, decrease waste, and use
empirical methods to decide what matters, rather than uncritically accepting pre-existing ideas.

You might also like