Starting from:

$25

Console Based-Assignment 2 Different Kind of Triangle Solved

. Binary Number?

Write a program that takes an integer as an input and determine if it is a binary number? For instance, 1010 is a binary number but 1012 is not.

2.  Exponentiation
Write a program that can compute the value of ex, for a given value of x, using Taylor series expansion, as follows:

ex = 1 + x + (x2 / 2!) + (x3 / 3!) + (x4 / 4!) + (x5 / 5!) + ….

The more the series is expanded, greater the accuracy. Take number of terms, for accuracy, as an input.

3.  Line Printing
Write a program that takes as an input parameters of a linear line and print a line using asterisks. For instance, the following line will be printed for y = 2x + 1 and end points (0,1) and (3,7):

      *

    *     

  *

*

4.  Grade plot
Write a program that plots the frequency of A, B, C, D and F grades in a test. User will enter marks of each student. Number of students and total marks of the test are to be taken as input. Criteria of a student scoring A grade is 90% or above,  B is 75% to 89%, C is 60% to 74%, D is 50% to 59%, and F is below 50%. The final result will be a plot, depicting the number of students in each grade. For instance, assuming a class of 35 students with 5 A, 12 B, 10 C, 4 D and 4 F, the output will be:

A: *****

B: ************

C: **********

D: ****

F: ****

5. Triangle Patterns
Write a program to print triangular patterns (as shown below) up to as many number of lines as input by the user. For instance, number of lines used in the following patterns is six.

 *

 **

 ***

 ****

 *****

 ******
      *

     **

    ***

   ****

  *****

 ******
  ******

  *****

  ****

  ***

  **

  *
******

 *****

  ****

   ***

    **

     *
   *

   ***

  *****

  *******

  *********

  ***********
(a)
 (b)
(c)
(d)
 (e)
 

More products