by CodeChum Admin
As I've said before, there are three types of numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.
Let's code this.
Input
1. A series of decimal numbers
Output
The first lines will contain message prompts to input the decimal numbers.
The last line contains the sum of all negative numbers with 3 decimal places.
Enter·a·number:·2.4434
Enter·a·number:·-1.3433
Enter·a·number:·-2.444
Enter·a·number:·6.432
Enter·a·number:·0
Sum·of·all·negatives·=·-3.787
by CodeChum Admin
Remember the game of FizzBuzz from the last time? Well, I thought of some changes in the game, and also with the help of loops as well. Firstly, you'll be asking for a random integer and then loop from 1 until that integer. Then, implement these conditions in the game:
Input
1. An integer
Output
The first line will contain a message prompt to input the integer.
The succeeding lines will contain either a string or an integer.
Enter·n:·15
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
by CodeChum Admin
Make a program that will accept an integer and loop from 1 to that integer. Then, print all numbers from that range that are greater than 3.
Let's go!
Input
1. An integer
Output
The first line will contain a message prompt to input the integer.
The succeeding lines contain an integer.
Enter·n:·8
4
5
6
7
8
Make a c++ program that will print the average of the values of an array named areas with values 84, 76, 48 using while loop.
Make a c++ program that will display netpay of employee by inputting the basic pay and overtime pay. It should compute first the gross pay which which is the sum of the input values and the tax which is 10% of the basic pay. The netpay is gross pay minus tax. Use a function for each computation.
Make a c++ program that will print the highest number of the three input number using a function.
Using C# and Visual Studio, design and implement a standalone command line application that fulfils the following requirements:
1. The user shall be able to enter the following values:
a. Gross monthly income (before deductions).
b. Estimated monthly tax deducted.
c. Estimated monthly expenditures in each of the following categories:
i. Groceries
ii. Water and lights
iii. Travel costs (including petrol)
iv. Cell phone and telephone
v. Other expenses
2. The user shall be able to choose between renting accommodation or buying a property.
3. If the user selects to rent, the user shall be able to enter the monthly rental amount.
4. If the user selects to buy a property, the user shall be required to enter the following values for a home loan:
a. Purchase price of property
b. Total deposit
c. Interest rate (percentage)
d. Number of months to repay (between 240 and 360)
5. The software shall calculate the monthly home loan repayment for buying a property based on the values that the user entered
Write a program in which inheritance and other oop concepts are used.
You have to write code in which we will get the output of quiz test.
Player enter the name and roll no and quiz test will start
You should use fstream and question will be in in .txt file
( The question you copied are as follow
1.WHEN COMPUTER WAS FIRST INVENTIONED?
a.1822
b.1823
c.1834
d.1922
a
2.WHO kILLED PRESEDENT BENOGIR VUTTO?
a.nawaz shrif
b.pervase
c.non of them
d.political leder
c
3.WHO IS THE CAPTAIN OF BANGLADESH CRICKET TREAM?
a.asharaful
b.murtaja
c.rafiq
d.aftab
a
4.WHAT IS OUR NATIONAL GAME?
a.cicket
b.football
c.hadodo
d.badminton
c
5.WHO IS NOW CHIEFJUSTICS IN BANGLADESH?
a.yeaz uddin
b.moin
c.jalil
d.fakhar uddin
d
6.WHO IS THE PRIME MINISTER OF INDIA?
a.sonia gundi
b.rajib gundi
c.autol biharipal
d.pervase
c
7.WHAT IS THE DATE OF SIDDR ORCUS?
a.16th nov
b.17th nov
c.18th nov
d.20th n0v
a
8.WHEN WILL BE THE NEXT WORLD CUP CRICKET?
a.2011
b.2012
c.2009
d.2008
a
)
20 marks
3) Write a C++ program to solve the following problems (Red colour texts are to indicate user inputs that can be changed)
A) Calculate the area of a circle by accepting the radius of the circle from the user (NB: Area of Circle = 2חr)
Out Put
What is the radius of the circle: 10
Area = 62.8
B) Calculate the factorial of any integer number input from the user (NB: 4! = 1 * 2 * 3 * 4 = 24)
Out Put
Enter an Integer Number: 4
4! = 24
C) Waliya Bank is giving 7% interest for customer deposit, write a C++ program which enables customers to predict their total balance if they deposit an amounts and keep it for some time
Out Put
Enter your Account Number: 2000342200267
Enter your Name: Abebe Kebede
Enter the amount: 1000
How long to keep it (number of month): 10
Dear Abebe Kebede
Acc: 2000342200267
After 10 Months you will get a total of 700 Birr Interest
Your Balance will be = 1700 Birr
write program to print the area of rectangle by creating class name 'Area' with the method of cumpute area which take the value of it is length and width as parameter and return area of rectangle length and width of rectangle area entered through keyboard