Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

 LOOP: (TURBOc++)



 

Prg15: Write a program that displays a multiplication table for a given number.

Sample output:      Enter a number: 3

                              Multiplication table for 3:

 3 x 0 = 0

3 x 1 = 3

3  x 9 =27



PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


 LOOP: (TURBOc++)


PRG14. Write a program that will accept 10 numbers, identify if the number is odd or even, then finds the sum of all odd numbers, all even numbers, and total of all the numbers entered.

 


PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


 LOOP: (TURBOc++)



Prg16: Program that accepts a number then output the sum of the squares from 1 to n.

Enter a number : 4

1^2 + 2^2 + 3^2 + 4^2 = 30


PLEASE USE:

#include<stdio.h>

#include<conio.h>


scanf

printf

 


example:

#include<stdio.h>

#include<conio.h>

main()

{

int n=1, x=20;

clrscr();

printf("While Loop Example");


while (n<=5)

{

gotoxy(x, 3);printf(" %d", n);

n++;x=x+5;

}

getch();

}


a. Declare a single structure data type suitable for a car structure of the type illustrated:


Car Number

Miles Driven

Gallons Used

25 1450 62

36 3240 136

44 1792 76

52 2369 105

68 2114 67

 

b. Using the data type declared for Exercise 2a, write a C++ program that inter-actively accepts the above data into an array of five structures. Once the data have been entered, the program should create a report listing each car number and a miles per gallon achieved by the car. At the end of the report include the average miles per gallon achieved by the complete fleet of cars.

 

The Harris–Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your basal metabolic rate, or BMR. The formula for the calories needed for a woman to maintain her weight is BMR = 655.1 + ( 9.563 × weight in kg ) + ( 1.850 × height in cm ) – ( 4.676 × age in years ) The formula for the calories needed for a man to maintain his weight is BMR = 66.5 + ( 13.75 × weight in kg ) + ( 5.003 × height in cm ) – ( 6.755 × age in years )

A typical chocolate bar will contain around 230 calories. Design an algorithm and write a program using switch case that allows the user to input his or her weight in kilograms, height in centimeters, age in years, and the character M for male and F for female. The program should then output the number of chocolate bars that should be consumed to maintain one’s weight for the appropriate sex of the specified weight, height, and age.


Write a program that will simulate the Paper, Rock, Scissors game. Two players should be able to either P, R or S then the program shall determine who the winner is and state why he wins based on the following criteria

Paper covers Rock
Scissor cut paper
Rock breaks scissors


Sample Output
PAPER ROCK SCISSORS GAME
Player 1: P Player 2: S

Player 2 wins. Scissors cut Paper


please use ,
#include<stdio.h>
#include<conio.h>

scanf:
printf
Write a program that will calculate and show bills of the Electric Company. The rates vary depending on whether the use is residential (R), commercial( C) , or industrial (I). Any other code should be treated as an error.
The program should accept the subscriber ID, Subscriber Name, his total electrical consumption in a month, and the code of the consumer type.

The rates are computed as follows:

R: 50 plus .50 per kwh used
C: 100 for the first 1000 kwh and 0.45 for each additional kwh
I: 180 for the first 1000 kwh and 0.75 for each additional kwh


please use ,
#include<stdio.h>
#include<conio.h>

and,
scanf:
printf

Write a function template named maximum() that returns the maximum value of three arguments that are passed to function when it is called. Assume that all three arguments will be of the same data type.

Create an abstract class 'Bank' with an abstract method 'getBalance'. $100, $150 and $200 are deposited in banks A, B and C respectively. 'BankA', 'BankB' and 'BankC' are subclasses of class 'Bank', each having a method named 'getBalance'. Call this method by creating an object of each of the three classes


a,b,c = int user


x=\frac{-b+\sqrt{b^2-4ac}}{2a}


flowchart, pseudocode, c++


LATEST TUTORIALS
APPROVED BY CLIENTS