+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
Dear Student Please discus here about this Assignment :) . Thanks
Tags:
+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)
+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)
+ Click Here to Search (Looking For something at vustudents.ning.com?) + Click Here To Join (Our facebook study Group)jo program is tarha kary return 0; say pahly system("pause"); laga do
system("pause"); lagane se error de raha hai ka
system is not defined in this scope
errors aa rahian hain es main. Kiya code sy phele koi directory lagani hai??
koe btaye ga output rukti ku ni jaldi se chali jati hai????
@Fiinder system("pause"); add kro code k end pr output ruk jaye gi.
system("pause"); lagane se error de raha hai ka
system is not defined in this scope
/*
Assignment No : 3
VU-ID:
Name:
Date: 19/01/16 17:31
*/
#include<iostream>
#include <cstring>
using namespace std;
class Computer
{
private :
string Vendor;
string CPU;
int Hard_Disk;
int Ram;
public :
// setter functions
void setVendor(string vndr)
{
this->Vendor = vndr;
}
void setCPU(string cpu)
{
this->CPU = cpu;
}
void setHDD(int hdd)
{
this->Hard_Disk = hdd;
}
void setRam(int ram)
{
this->Ram = ram;
}
// getter funstions
string getVendor()
{
return Vendor;
}
string getCPU()
{
return CPU;
}
int getHDD()
{
return Hard_Disk;
}
int getRam()
{
return Ram;
}
// Default constructor
Computer()
{
cout"\n\nDefault constructor called....\n";
Vendor = "None";
CPU = "None";
Hard_Disk = 0;
Ram = 0;
}
// parameterized constructor
Computer(string vndr, string cpu, int ram, int hdd)
{
cout"\n\nParameterized constructor called....\n";
setVendor(vndr);
setCPU(cpu);
setHDD(hdd);
setRam(ram);
}
};
main()
{
Computer pc1;
cout"\nVendor : "pc1.getVendor();
cout"\nCPU : "pc1.getCPU();
cout"\nRAM : "pc1.getRam();
cout"\nHard Disk : "pc1.getHDD();
Computer pc2("Intel", "i5", 4, 500);
cout"\nVendor : "pc2.getVendor();
cout"\nCPU : "pc2.getCPU();
cout"\nRAM : "pc2.getRam();
cout"\nHard Disk : "pc2.getHDD();
coutendl;
cout"--------------------------------- "endl;
system ("pause");
return 0;
}
cs201 solution 2016
CS201 Assignment 3(Solution)
class computer{
}
public: // for the public variables.
void setModel(string s);
string getModel();
void setRamMemory(int i);
int getRamMemory();
computer();// define constructor without parameters
computer(string, int);// define constructor with parameters
private: // for the private variables.
string Model;
int RamMemory;
computer::computer(){
Model="None";
RamMemory=0;
}
computer::computer(string Model,int RamMemory){
setModel(Model);
setRamMemory(RamMemory);
}
void computer::setModel(string s){
Model=s;
}
void computer::setRamMemory(int i){
RamMemory=i;
}
string computer::getModel(){
return Model;
}
string computer::getRamMemory(){
return RamMemory;
}
int main()
{
cout "computer without paramerters" endl;
//initialize the constructor and display
computer comp1; cout"Model == " comp1.getModel() endl;
cout"RAM Memory == " comp1.getRamMemory() endl;
cout "computer with paramerters" endl;
computer comp2("IBM",5);
cout"Model == "comp2.getModel() endl;
cout"RAM Memory == " comp2.getRamMemory() endl;
return 0;
}
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post