CSN-104 - Computer Programming - Conditional and Iterative Statements - Factorial - Quadratic Equation - Computer Science Assignment Help

Download Solution Order New Solution
Assignment Task:

Algorithm & Flowchart 
 
Write an algorithm and draw a flowchart for the following problems: 
 
1.
To find the factorial of a number entered by the user.  
2. To find the Fibonacci series till term ≤ 1000.  
 
Write C++ code for the following: 
 
1. Determine if the following statements have any errors. If so, highlight them and explain why. 
a.   int 1st value=20; 
b.   Assume < x=0, y=0, zero=1;> zero =(x=1) && (y=0); 
c.   Assume < x=10, y=3, z=0;> y=++x+y; z=z−−>x; 
d.   CHAR c = ‘b’; 
2. Consider the statement double ans = 20.0/multiply(2+3)  For each of the below mentioned four versions of the function macro multiply () below, write the corresponding value of ans variable.

a. #define multiply (x) x*x

b. #define multiply (x) (x*x)

c. #define multiply (x) (x)*(x) d. #define multiply (x) ((x)*(x))        

3. Consider int val=0xFACE; Write expressions using bitwise operators that do the following:

A. test if at least three of the last four bits (LSB) are on

B. reverse the byte order (i.e., produce val=0xCEFA)

C. rotate four bits (i.e., produce val=0xEFAC)      

4. Write a CPP program that accepts a real number x from the keyboard and prints out the corresponding value of sin(1/x) using 4-decimal places.     5. Write a program to print the HCF and LCM of two numbers. 
6. To find the power of a number using loops.

a.   Modify the above program to work using goto statement.

7. To print the largest of n numbers, where the value of n and corresponding numbers are read form the users. Use test to check if valid value of n is entered by the user.

a.   Modify the above program to work with the conditional operator.

8. Read the roll no of any student studying in PEC and print the following:

a.   Year of enrollment and completion

b.   The discipline of the student

c.   Serial number in registration list

9. A decimal number between 0 and 32 exclusive can be expressed in a binary system with either zero or one. Write a C program that accepts (from the terminal) a decimal number in the above range and prints out the equivalent binary representation.

10. A positive decimal fraction can also be expressed in binary system with either zero or one. Write a C program that accepts (from the keyboard) a positive decimal fraction a (0 < a <1) and prints out at most first four bits of the equivalent binary representation. If the binary representation continues after four bits, then it appends the binary representation with “…”.

11. Write a program to find roots of the quadratic equation. Your code should work even if the roots are imaginary.

12. A perfect number is a positive number in which the sum of all positive divisors excluding that number is equal to that number. Write a program that accepts a positive integer from the keyboard and checks whether the entered number is a perfect number.

13. Write a C++ program to check whether the character entered by the user is an alphabet, digit or special character.

14. Write a program that determines a student’s grade. The program will read the following information from the user:

a. Read the maximum marks and marks attained for 3 quizzes. Scale each quiz marks to 30 marks and then compute the overall marks out of 30 for quiz.

b. Read the maximum marks and marks attained for MST. Scale the marks to 30 for MST.  

c. Read the maximum marks and marks attained for EST. Scale the marks to 40 for MST.  

d. Compute the total marks and determine the grade based on the following rules: 
 
-if the score = 90% => grade=A

-if the score >= 70% and <90% => grade=B

-if the score>=50% and <70% => grade=C

-if the score<50% => grade=F 

This CSN104 - Computer Science Assignment has been solved by our Computer Science Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.