Heetcm102a introduction to digital electronics

Assignment Help C/C++ Programming
Reference no: EM132629834

HEETCM102A Introduction to Digital Electronics and Programming Fundamentals

Assessment : C Programming

Part A:

Write a program to select your question from the Part B.

Program must tell the user (you) to enter the student ID no (student ID has 9 digits. eg: 202012345). Then the program must add up all the digits and find the sum of the digits. Then program must divide that number by 5 and find the remainder. Based on the remainder value,display a message advising the student their relevant question from Part
B. Questions are assigned as below:
• If remainder = 0; Select Question 1.
• If remainder = 1; Select Question 2.
• If remainder = 2; Select Question 3.
• If remainder = 3; Select Question 4.
• If remainder = 4; Select Question 5.
Ex:
If your student ID is 202012345, the sum of all the digits is: 2+0+2+0+1+2+3+4+5 = 19. When 19 is divided by 5, the remainder is 4. So this student must select Question 4 from part B and answer that only.

Part B : Only select the question relevant to you and answer that ques- tion.

Question 1 Problem on converting decimal numbers to octal values.
Tell the user to enter a number greater than 50. Then check whether the user entered number is greater than 50 or not. If the number is not greater than 50, display the message "Please enter a number greater than 50!".
If the user has entered a number greater than 50, your program must calculate the OCTAL representation of that number using a function, and finally display the correct OCTAL number.

Question 2 Problem on area and perimeter of triangles.
Tell the user to enter the lengths of the sides of a triangle (a,b and c). Use a function to check whether the triangle is right-angled or not ( you can use Pythagoras' theorem for this).
If the triangle is right-angled, then you must find the find the area of the triangle and print it out. If the triangle is NOT right-angled, then you must find the perimeter of the triangle and print that out.
Note: If you want to use the sqrt() to find the square root, please type the following two lines, at the start of the program.
include<stdio.h> include<math.h>

Question 3 Problem on Body Mass Index.
Tell the user to enter his/her height (in m) and weight (in kg). Then calculate the user's Body Mass Index (BMI) using the following formula.
BMI = weight in kg/(height in m)2
After BMI is calculated, according to the following list, a message should be displayed
according to the calculated BMI value.
• If BMI value is less than 18.5 - Underweight
• If BMI value is between 18.5 and 24.9 - Healthy weight range
• If BMI value is between 25 and 29.9 - Overweight
• If BMI value is 30 or over - Obese

Question 4 Problem on finding the factorial of a number.
Tell the user to enter a positive number. Then check whether the user entered number is positive or not. If the number entered is not positive, display the message "Please enter a positive number!".
If the user has entered a positive number, you must write a program to calculate the
factorial of that number and display the value.
Note: If user entered 5, then the factorial of 5 is calculated as 5*4*3*2*1 = 120. So the program must display a message saying "The factorial of 5 = 120"

Question 5 Problem on a 5 digit number.
Tell the user to enter a 5 digit number. Then check whether the user entered number has 5 digit number or not. If the number entered does not have 5 digits, display the message "Please enter a 5 digit number!".

If the user entered a 5 digit number, use a function to calculate the square of each digit and add them together and display the answer.

12 + 22 + 32 + 42 + 52 = 55. So the program must display a message saying: Note: If user entered 12345, then the sum of squared digits will be calculated as: "The sum of squared digits of 12345 = 55

Reference no: EM132629834

Questions Cloud

Benefits of model in quantitative decision making : 1. Discuss at least four benefits of model in quantitative decision making?
Can Tom disclose to Alice the problems at Anchovy : Big CPA Firm has many partners in one of its local offices. Can Tom disclose to Alice the problems at Anchovy
Why might a writer feel compelled to write about literature : Why might a writer feel compelled to write about literature? How does it benefit us personally and/or professionally? What kind of writing and thinking skills.
Find fill rate by the distribution center : Your company orders one pallet of assorted finished goods from a regional distribution center every Wednesday, 52 weeks a year.
Heetcm102a introduction to digital electronics : HEETCM102A Introduction to Digital Electronics and Programming Fundamentals Assignment Help and Solution - Problem on finding the factorial of a number
What does literature offer an individual : What does literature offer an individual? How has the importance of reading changed from earlier eras (pre-digital/audio/visual media) to our present day?
What are the potential consequences for Sarah : How should Sarah handle this situation? What are the potential consequences for Sarah if she agrees to do what Jeff suggests
What are the 4 different leadership style : 1. Define two of the following and tell me the advantages and disadvantages of your chosen choice.
Laws regulating speech must be content neutral : What does it mean that laws regulating speech must be content neutral? How does the Supreme Court determine whether material is obscene?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd