Vous êtes sur la page 1sur 2

1.

Write a c# program to computes the future value of an mutual fund investment that has a fixed
rate of return over a period of years.(Hint: Use decimal type anf formuala is [amt=amt +(amt*
rate)] in a loop for n years]
Original investment: $1000
Rate of return: 0.07
Over 10 years
Future value is $1967.151357289565322490000

2. Write a C# program to that takes a number as input and display it four times in a row
(separated by blank spaces), and then four times in the next row, with no separation.
Repeat it two times: Use String Interpolation
Test Data:
Enter a digit: 25 
Expected Output:
25 25 25 25 
25252525 
25 25 25 25 
25252525

3. Write a c# Program to determine the area of any triangle by Heron’s Formula


Heron's formula states that the area of a triangle whose sides have lengths a, b, and c is

Where s is the semi-perimeter of the triangle.

4. Write a C# program to accept a coordinate point in an XY coordinate system and determine in


which quadrant the coordinate point lies.
5. Write a C# program that will calculate the tax of salaried persons as per given policy.*
*RBI India announces the tax policy for 2017-2018. As per the Finance Act passed by
Government of India, following slabs and income tax rates shall be applicable for salaried
persons and salaried class for the year 2017-2018: 1. Where the taxable salary income does not
exceed Rs 400,000, the rate of income tax is 0%; 2. Where the taxable income exceeds Rs
400,000 but does not exceed Rs 500,000, the rate of income tax is 2% of the amount exceeding
Rs 400,000. 3. Where the taxable income exceeds Rs 500,000 but does not exceed Rs 750,000,
the rate of income tax is Rs. 2,000 + 5% of the amount exceeding Rs 500,000. 4. Where the
taxable income exceeds Rs 750,000 but does not exceed Rs 1,400,000,the rate of income tax is Rs
14,500 + 10% of the amount exceeding Rs 750,000. 5. For the rest of cases, the tax rate
is Rs.17,500+20% of the amount exceeding Rs. 750,000.*

6. If a scientist knows the wavelength of an electromagnetic wave, he or she can determine what
type of radiation it is.  Write a c# program that asks for the wavelength of an electromagnetic
wave in meters and then displays what the wave is according to the data below.  
Wavelength between 0.00 and 0.01 -> Radio Wave
Wavelength between 0.01 and 0.001 -> MicroWave
Wavelength between 0.001 and 0.0000007 -> Infrared
Wavelength between 0.0000007 and 0.0000004 -> Visible light
Wavelength between 0.0000004 and 0.00000001 -> Ultraviolet
Wavelength between 0.00000001 and 0.00000000001 -> X-Ray
Wavelength between 0.00000001 and 0.00000000001 -> X-Ray
Wavelength > 0.00000000001 ->Gamma Ray

7. Write a C# program to calculate the total number of days in a given month and year.
Test Data 1:
Enter month:12
Enter Year :2018
Output: December 2018 has 31 days
Test Data 2:
Enter month:2
Enter Year :2016
Output: February 2016 has 29 days

Vous aimerez peut-être aussi