[solved] – Question 88755

Write a C++ program to write 5 records into a binary file “EMP. DAT” corresponding to the following class emp.

class emp
{
into eno;
char ename[20];
public:
void getdata ( )
{ cout <<“Enter employment no”;
cin >>eno;
cout <<“Enter name “;
cin>>ename; }
void put data ( )
{ cout <<“empno = “<<eno <<endl;
cout <<“Name= ” <<ename <<endl; } };

Expert Answer


[solved] – Question 88756

How is pointer different from ordinary variable? What is the output of the following program segment ?

#include <in stream. h>
void main ( )
{

char *st=”Beautiful “
st++;
cout <<st <<endl;
st+=2
cout <<st <<endl;
}

Expert Answer


[solved] – Question 8876

Write an application containing three parallel arrays that hold 10 elements each. The first array holds four digit student ID numbers, the second holds first names and the third holds the students grade point averages. Use dialog boxes to accept a student ID number and display the student’s first name and grade point average. If a match is to found, display an error message that includes the invalid ID numbers and allow the user to search for a new ID number. This is for an assignment that is due monday,would appreciate it if you can help me before the due date.

Expert Answer


[solved] – Question 8878

1) A) Use a loop to print a list of numbers from 1 to 20. You can use either a ‘while’ loop or a ‘for’ loop.

1
2
3
.
.
20
B) Below that, add another loop that will display the numbers 1 through 10 and the times table for the number 7, like this:

1 times 7 is 7
2 times 7 is 14
3 times 7 is 21
.
.
10 times 7 is 70
C) Allow the user to enter a number to be used in the times table in place of the 7.

2) A) Use an ‘if’ statement to calculate the taxes due based on a flat tax rate of 10%, with no taxes due for anyone who has a salary less than $10,000. For this part you can enter the salary directly in the code.
B) Setup the HTML page to allow the user to enter a salary.
C) Adjust your formula so that the tax rate on all income about $25,000 is 20%.

Expert Answer


[solved] – Question 8881

Write a class TelephoneNumber that will hold a telephone number. An object of this class will have attributes .. areaCode—a three-digit integer,exchangeCode—a three-digit integer,number—a four-digit int
and the methods
1.TelephoneNumber(aString)—a constructor that creates and returns a new instance of its class xxx–xxx–xxxx or,if the area code is missing, xxx–xxxx. Throw an exception if the format is not valid Hint hyphen in the telephone number with a blank. To accept a telephone number containing hyphens, you could process the string one character at a time or learn how to use Scanner to read words separated by a character—such as a hyphen—other than whitespace.)
2 .toString—returns a string in either of the two formats shown previously for the contructor.ae
using a text editor,create a text file of several telephone numbers,using the two formats described previously.Write a program that reads this file,displays the data on the screen,creates an array whose base type is Telephone Number.allow the user to

Expert Answer


[solved] – Question 88907

List and explain IN YOUR OWN WORDS the fundamental principles of Object Oriented Programming. Use an example in plain English to explain your answer. If you type any code to demonstrate, you will lose points. Do not simply copy any answers from the web – you will lose points for that as well.

Expert Answer


[solved] – Question 88953

#include <iostream>
using namespace std;

void main()
{
int no1, no2, no3;

cout << “Enter the first value : “
cin >> no1;
cout << “Enter the second value : “
cin >> no2;

if (no1 < no2)
min = no1;
if (no2 <= no1)
min = no2;

cout << “The lowest value is “ << min << endl;
}

(a)What is the output if the value for no1 is 5 and no2 is 6? Provide the tracing table.
(5 marks)

(b)Edit the program to output the highest value.

Expert Answer


[solved] – Question 88954

tudy the following flowchart:

(a)Declare ALL the variables.
(5 marks)

(b)Write the C++ statements based on the flow chart below.
(10 marks)

(c)Based on the program, prepare the tracing table to trace for the output if the sale is:

•RM6000.00
•RM1200.00
(10 marks)

Expert Answer


[solved] – Question 8897

(a)Assemble the following instructions and show the changes in given Accumulator register and flags after each instruction execution.

MOV AL, 8Bh; CF = ?, SF = ?, PF = ?, ZF = ?

ADD AL, 22h; CF = ?, SF = ?, PF = ?, ZF = ?

AND Al, 1000101b; CF = ?, SF = ?, PF = ?, ZF = ?

OR Al, 9Ah; CF = ?, SF = ?, PF = ?, ZF = ?

XOR AL, 10101011b; CF = ?, SF = ?, PF = ?, ZF = ?

TEST AL, 2; CF = ?, SF = ?, PF = ?, ZF = ?

CMP AL, 58; CF = ?, SF = ?, PF = ?, ZF = ?

ADC AL, 11110000b; CF = ?, SF = ?, PF = ?, ZF = ?

SHR AL,2; CF = ?, SF = ?, PF = ?, ZF = ?
——————————————————————————————–
b)
Write a subroutine that can calculate the sum of an array and also save the result into DX.
( Array’s length is 20)
——————————————————————————————

Expert Answer


[solved] – Question 88980

Start with the program of Exercise 1 in this chapter, and add a member function of typeboolcalledisOversize()to the bookandtapeclasses. Let’s say that a book with morethan 800 pages, or a tape with a playing time longer than 90 minutes (which wouldrequire two cassettes), is considered oversize. You can access this function from main()and display the string “Oversize” for oversize books and tapes when you display theirother data. If bookandtapeobjects are to be accessed using pointers to them that arestored in an array of type publication, what do you need to add to the publicationbase class? Can you instantiate members of this base class?

Expert Answer