Write a program that prompt the user to enter the two points

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

Project: Elementary Aspects of C++

a. Modulo Division Write a program to read in a 3-digit integer and print out the sum of the digits of the integer. Use the % operator to extrct the digits and use the / operator to extract the digit.

b. Approximating Pi: Pi can be computed using the formula 4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - . . .)

Write a program to display the result of 4 * (1.0 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13)

Note: be sure to use 1.0 not 1 in your program.

c. Wind Chill The National Weather Service has a relatively new formula to measure the wind chill temperature. The formula is

Wind Chill = 35.74 + 0.6215 T - 35.75 V0.16 + 0.4275TV0.16

Where T = outside temperature (°F) and V = wind velocity (mph). The formula cannot be used for wind speeds below 2 mph, temperatures below -58°F, or temperatures above 41°F.

Write a program that prompts the user to enter a temperature and a wind speed, and then displays the wind chill temperature. You may assume the values entered are valid.

Enter temperature (Fahrenheit): 5.3
Enter wind speed (mph): 6
The wind chill index is -5

d. Distance Given the two points (x1, y1) and (x2, y2), the distance between these points is given by the formula:

d= √[(x2-x1)2+(y2-y1)2]

Write a program that prompts the user to enter the two points, and then displays the distance between them. You may assume the values entered are valid.

Reference no: EM13963473

Questions Cloud

Handling the exception tl : Consider the function fun g(l) = hd(l) : : tl(l) handle Hd => nil; that behaves like the identity function on lists. The result of evaluating g(nil) is nil. Explain why. What makes the function g return properly without handling the exception Tl?
What is the primary potential problem with ethical egoism : In your opinion, what is the primary potential problem with Ethical Egoism as a moral theory? Explain
Spectrophotometric data for kmno4 : 1. Scenario: You are in in the lab and just created the graph for Data Table 1. After looking at the data, for which concentration of solution would you repeat the absorbance measurement if enough time was left in lab? Why?
How gains or losses on impaired assets : Explain how gains or losses on impaired assets should be reported in income in IFRS.
Write a program that prompt the user to enter the two points : Write a program that prompts the user to enter the two points, and then displays the distance between them. You may assume the values entered are valid.
Mickley company''s predetermined overhead rate : Mickley Company's predetermined overhead rate is $23.00 per direct labor-hour and its direct labor wage rate is $15.00 per hour. The following information pertains to Job
Result of evaluating : Consider the following functions, written in ML: exception Excpt of int; fun twice(f,x) = f(f(x)) handle Excpt(x) => x;
Which has the greater wavelength, blue light or red light : A photon corresponding to a particular frequency of blue light produces a transition from the n = 2 to the n = 5 level of a hydrogen atom. Could this photon produce the same transition (n = 2 to n = 5) in an atom of X? Explain.
Explain the implications of research on parental behavior : In your initial post of a minimum of 350 words, explain the implications of the research on parental behavior and environmental factors as they relate to human personality development. Describe how this research data might be used to explain unhea..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program to check a social security number is valid or not

Write a program that prompts the user to enter a social security number in the format DDD-DD-DDDD, where D is a digit. The program displays "Valid SSN" for a correct social security number and "Invalid SSN" otherwise.

  Write a function called makemat that will receive two row

Write a function called makemat that will receive two row vectors as input arguments, and from them create and return a matrix with two rows.

  Find answers of c programming questions

1. int main(void){ int height 3. 5; int width = 25: if(height == 5 && width == 25){printf("the height and width are correct: "); }return 0; }Assuming all libraries are included, what is the result of the code above when run?

  Putting objects within objects is the essence of composition

Putting objects within objects is the essence of composition. It is called composition for obvious reasons. As we always say that if something is made from other things that it is composed from those things.

  What is the name header file (name.h)

getFirstLast Function: it returns the first and middle name and last name in order.

  Write a program that gives a prompt to the users

Write a program that gives a prompt to the users, asking for an integer n. It then prints out a random permutation, on one line , of 1,2,.......n separated by spaces or lines.

  How to call a function from main

Call a function from main(), passing one value to it. Return TWO values, both the square of the number and the number to the power of three.

  Declare and initialize an appropriate variable

Show the source code for a C# console application names ‘Sibs' that prints your frist name on the first line, your last name on the second line, and the number of siblings you have on the third line Declare and initialize an appropriate variable fo..

  What output is produced by the following program

What output is produced by the following program?

  Write a loop that read positive integers from standard input

Any value that is the same as the immediately preceding value is considered a CONSECUTIVE DUPLICATE. In this example, there are three such consecutive duplicates: the 2nd and 3rd 5s and the second 6. Note that the last 3 is not a consecutive dupli..

  Which of the following correctly invokes the function f

which of the following correctly invokes the function F, assuming N is an integer variable?

  Complete graphical and possibly networked two-player game

Analyze a basic set of requirements for a problem and create basic test cases for a program - Describe what is an attribute or data member of a class

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