Sunday, 9 December 2018

CS304 - Object Oriented Programming Fall 2018 Assignment No. 01 Solution

Leave a Comment
@page { margin: 0.79in } p { margin-bottom: 0.1in; direction: ltr; line-height: 115%; text-align: left; orphans: 2; widows: 2 } a:link { color: #0000ff } @page { margin: 0.79in } p { margin-bottom: 0.1in; direction: ltr; color: #000000; line-height: 115%; orphans: 2; widows: 2 } p.western { so-language: en-US } p.ctl { so-language: ar-SA } a:link { color: #0000ff } Problem Statement: We have the...
Read More

CS301 Assignment No 01 Solution Fall 2018

Leave a Comment
@page { margin: 0.79in } p { margin-bottom: 0.1in; direction: ltr; line-height: 115%; text-align: left; orphans: 2; widows: 2 } a:link { color: #0000ff } Binary Search tree is the most efficient data structure for solving different problems. Construction of BST (Binary Search Tree) depends on the order in which data is inserted into the tree. For building a Binary Search Tree, data should be inserted into a tree in a way...
Read More

Sunday, 18 November 2018

Time Class and Its Implementation in C++

Leave a Comment
Time.h #ifndef TIME_H#define TIME_H class Time{    public:        Time();        Time(int,int,int);        virtual ~Time();        Time(const Time& other);        int Gethour() { return hour; }        void Sethour(int val) { hour = val; }        int Getminutes() { return minutes; }        void Setminutes(int val) { minutes = val; }     ...
Read More

Sunday, 5 August 2018

DS Malik PROGRAMMING EXERCISES -- Chapter 3 -- Question 1 -- Solution

Leave a Comment
Question : 1. Consider the following incomplete C++ program: #include <iostream> int main() { ... } a. Write a statement that includes the header files fstream, string, and iomanip in this program. b. Write statements that declare inFile to be an ifstream variable and outFile to be an ofstream variable. c. The program will read data from the file inData.txt and write output to the file outData.txt. Write statements to open both of these files, associate inFile with inData.txt, and associate outFile with outData.txt. d....
Read More

DS Malik Chapter 3 Question 18 Solution

Leave a Comment
Question : Suppose that infile is an ifstream variable and it is associated with the file that contains the following data: 27306 savings 7503.35. Write the C++ statement(s) that reads and stores the first input in the int variable acctNumber, the second input in the string variable accountType, and the third input in the double variable balance. Explanation: Below mention code is compiled in Visual Studio 2015 and Code Blocks 13.12,output snap is attached.. If any problem you feel and you want some explanation...
Read More

Thursday, 8 February 2018

Write a program that asks the user for an integer and then prints out all its factors in increasing order. Example input us 150, it should print 2 3 5 5

Leave a Comment
Question:                 Write a program that asks the user for an integer and then prints out all its factors in increasing                  order. Example input us 150, it should print                  2                 3            ...
Read More

Sunday, 10 December 2017

CS201 - Introduction to Programming -- Assignment No.2 - Fall 2017 - Solution

Leave a Comment
Objectives: To enable students to write, compile and execute a program in DevC++. Moreover to familiarize students with  the concepts of: If else structure Loops Passing array to a function Multidimensional array declaration Multidimensional array manipulation Assignment: Write a program that will generate random numbers and that numbers will be stored in a two-dimensional array. Then display the generated...
Read More