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

  Define inheritance and polymorphism

Inheritance and Polymorphism, The objective of this programming assignment is to experience the use of inheritance in Java and to see how polymorphism works with inheritance in Java.

  Algorithm that returns the smallest value in the array

Write an algorithm that outputs the smallest and second smallest values in the array.

  Inheritance and output formatting

Inheritance and Output Formatting, finish the implementation of class name and derived classes person and employee in the following code. Format the output neatly using setw() and or other setioflags features

  Design an online address book to keep track of the names

Use the Composition (Aggregation) to Programming it on C++. I use visual studio 2012. Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certa..

  Value referenced by the pointer.

Add 10 to the value referenced by pointer switch.Add 4 to the address stored in pointer switch.Subtract 5 from the value referenced by the pointer.

  Program calculates and displays salesperson''s commission

The sales manager at Tompkins Company wants a program that calculates and displays each salesperson's commission, which is 10% of his or her sales. It also should display the total commission. Use a value-returning function to get the amount sold by ..

  Implementing a client

The CSE3300 server for this exercise waits to receive messages on UDP port 3300 of tao.ite.uconn.edu (IP address 137.99.11.9).1 It iteratively receives a request datagram containing a 32-bit integer representing a social security number

  Calculate tax pay and return the result

Calculate tax pay and return the result to main method. Print the result in main method.

  The above array is a declaration of an array of type integer

The above array is a declaration of an array of type integer. The name of the array is studentMark, and the array is of size 10. Arrays in C can be initialized by using a single statement that declares the array or by breaking it into two statements...

  Generate a main program which initializes

Generate a main program which initializes your data array to be sorted - be careful with your array index numbers. You can use a random number generator to generate entries for the array.

  Develop a simple poker game

Develop a simple poker game

  Building blocks of classes

How can you employer structures and utilize constructors? Explain the role of classes in encapsulating data.

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