Get premium membership and access questions with answers, video lessons as well as revision papers.
We use Scanner class to create the object that we will take the inputs from the user.
Duemak answered the question on June 2, 2019 at 14:29
#include
#include
using namespace std;
class largest
{
int num1, num2;
float large;
public:
void getdata();
void displaydata();
void getlargest();
void displaylargest();
};
void largest::getdata()
{
cout<<"enter first number...\n"< cin>>num1;
cout<<"enter the second number...\n"< cin>>num2;
}
void largest::displaydata()
{
cout<<"the first number is...\n"< cout<<"the second number is....\n"<}
void largest::getlargest()
{
if(num1>num2)
{
large=num1;}
else{
large=num2;
}
}
void largest::displaylargest()
{
cout<<"the largest number is...\n"<}
int main()
{
largest largen;
largen.getdata();
largen.displaydata();
largen.getlargest();
largen.displaylargest();
getch ();
}
Totosha answered the question on July 3, 2019 at 13:57
- Compare and contrast Multiprogramming, Multitasking and Multiprocessing(Solved)
Compare and contrast Multiprogramming, Multitasking and Multiprocessing
Date posted: March 5, 2019. Answers (1)
- Write a C function that has three inputs which are integers. The function returns true if the
first number raised to the power of the second...(Solved)
Write a C function that has three inputs which are integers. The function returns true if the
first number raised to the power of the second number equals the third number.
Date posted: March 5, 2019. Answers (1)
- Write a C function that computes that maximum of a specific row R in a 2D array of size 6 by 5.(Solved)
Write a C function that computes that maximum of a specific row R in a
2D array of size 6 by 5.
Date posted: March 5, 2019. Answers (1)
- What will be the output of the following c program?(Solved)
#include
int *p, x;
int a[5]={100,200,300,400,500};
int *p2;
int main()
{
p=NULL;
x=500;
p=&x;
printf("1) %d %d \n",x,*p,p,&x,&p);
p2=a;
*(p2+1)=*p;
*p= *p2 + *(p2+2);
printf("2) %d %d \n",x,*p,*p2);
return 0;
}
Date posted: March 5, 2019. Answers (1)
- What is the relationship between threads and processes?(Solved)
What is the relationship between threads and processes in computer operating system?
Date posted: March 5, 2019. Answers (1)
- What is the function of the ready queue?(Solved)
Explain the function of ready queue as in operating system
Date posted: March 5, 2019. Answers (1)
- Define the following as used in visual basic programming
1.Variables
2.Constant(Solved)
Define the following as used in visual basic programming
1.Variables
2.Constant
Date posted: January 28, 2019. Answers (1)
- What is Cryptography?(Solved)
What is Cryptography?
Date posted: December 27, 2018. Answers (1)
- What is an Operating System(OS)?(Solved)
What is an Operating System(OS)?
Date posted: December 27, 2018. Answers (1)
- What is cryptocurrency?(Solved)
Explain the meaning of cryptocurrency as used in the digital world and how it works.
Date posted: December 26, 2018. Answers (1)
- What is TCP Chimney Offload?(Solved)
What is TCP Chimney Offload?
Date posted: December 24, 2018. Answers (1)
- How do you use the disk-part command to assign a drive a letter?
(Solved)
This question is for all IT students,meaning that it is a basic thing to know for all people dealing with computing,especially programmers.The answer shows how to exactly assigning a drive a letter using the command prompt,it is an easy to learn question.This brings us to the disk-part command which is what the question is asking.
Date posted: December 24, 2018. Answers (1)
- How do you stop the ping command?
(Solved)
This question is a university question talking about an example of a command in the command prompt window,the ping command.One might find a big sense in this question by just researching on the answer more.
Date posted: December 24, 2018. Answers (1)
- How do you remove a virus using the command prompt?(Solved)
How do you remove a virus using the command prompt?
Date posted: December 24, 2018. Answers (1)
- How do you create a HTML program using notepad?(Solved)
This question talks about how you can create your own basic HTML program using only the notepad and an internet software like Internet explorer.The answer has it all.
Date posted: December 24, 2018. Answers (1)
- Give atleast 6 character set special symbols as used in C language program.(Solved)
Give atleast 6 character set special symbols as used in C language program.
Date posted: December 21, 2018. Answers (1)
- Systems programs enable the operating system to facilitate the editing, compiling, loading and I/O processing services. Explain (Solved)
Systems programs enable the operating system to facilitate the editing, compiling, loading and I/O processing services. Explain
Date posted: December 18, 2018. Answers (1)
- Outline the five state model of a process in operating systems(Solved)
Outline the five state model of a process in operating systems.
Date posted: December 18, 2018. Answers (1)
- Discuss the differences between Bespoke software and Generic software(Solved)
Discuss the differences between Bespoke software and Generic software.
Date posted: December 14, 2018. Answers (1)
- What is bios?(Solved)
What is bios?
Date posted: December 11, 2018. Answers (1)