Pia tunatoa huduma zifuatazo.

Tunatengeneza blogu, tovuti(website), youtube chaneli n.k.. Mawasiliano:
simu:+255763670000, Barua pepe: khalfanm021@gmail.com
Showing posts with label cpp-programming. Show all posts
Showing posts with label cpp-programming. Show all posts

Sunday, September 16, 2018

Question Aim: Pascal triangle using array

Question: Write a C++ program using array that will print or display pascal triangle

Solution


NOTE: For a newbie in C++ it's difficult to understand the solution above as it has POINTERS, but don't worry about that, YOU JUST REVISIT THIS BLOG LATER ON THE DISCRIPTIONS OF THE CODES ABOVE WILL BE GIVEN


PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL



Question aim: Displaying pascal triangle without using array

Question: Write a C++ program that prints or displays pascal triangle on screen

Solution



PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL



Question aim: Calculating average using a while loop in entering values

Question:  Write a C++ program that asks a teacher to enter marks of five  subjects of his/her student and then calculate the average of the marks entered.
HINT: Use a while loop to iterate the five marks entered, when the fifth mark has been entered, the loop should exit, calculate the average and display the result. Sample output should be;

     Enter marks: 10
     Enter marks: 20
     Enter marks: 30
     Enter marks: 40
     Enter marks: 50
    The average is: 30.00

Solution


PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL



Question aim: Determination of negative or positive number and its weight in another number

Question: Write a c++ program to ask a user to enter a number, if a number is negative it should display "Negative number entered!" else if it is positive, it should determine if that number is greater than 10 or not.

Solution



PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL

Question Aim: testing whether the lengths supplied form a triangle.

Question: The triangle inequality theorem states that the sum of the lengths of any two sides of a triangle must be greater than or equal to the length of the third side. Write a program that asks a user tp enter lengths of the three sides of a triangle. The program then tests whether the lengths supplied form a triangle.

Solution


PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL