Write a program that converts a line of data

Assignment Help Basic Computer Science
Reference no: EM13771084

Problem 1: Arithmetic Operations?Fill in the blank. What is the value of k in the following statements using integer arithmetic. Problem 1. k = 3 + 9 % 5 - 6?        -------------

Problem 2. k = 7 / 6 + 7 % 6?        --------------

Problem 3. k = (7 / 6) * (9 % 7)     --------------

Problem 4. k = (11 + 6) < (7 * 3)      --------------

 Problem 5. k = ('5' - '1') + ('7' - '2')   ---------------

3 Program Statements-

In problems 16-20, show all additional variable names and types that you choose to use.

Problem 6. Write a statement that will convert x pounds to y grams (recall: 454 g = 1 lb).

Problem 7. Write two statements for calculating the circumference of a circle, given the radius (recall A = πr2 and π = 3.14).

Problem 8. Write a statement that will convert n inches to f feet (recall: 1 ft = 12 in).

Problem 9. Write a statement that can be used to calculate the volume of a sphere, given the radius V = 4/3πr3.

Problem 10. Write a statement that can be used to calculate the volume of a cylinder V = πr2h.

4 Program Analysis-?Fill in the blanks. Problem 22 refers back to problem

21.

Problem 13. charch = '3'; declares that ch is a variable.

Problem 14. long b = 3; declares that b is a variable. Problem 15. long m; m = 3.1*4;

cout<< "m: " << m; will write:

Problem 16. There are at least five errors in the program below. Circle five and only five of them. Each error is worth two points. // test1.cpp

#include<iostream.h>

main() {

integer  j, k;

double   x, y;

cout<< "Enter two numbers: " cin>>x,y;?cout<< x << y;

/ /read values?cout<< "Enter two more numbers: "; cin>>k,j;?double a=x+y;?double b=k*j;?if( a => b )

cout<< "product is less than sum" <<endl;

else

cout<< "product is greater than sum";

return 0;

}

Problem 11. double x = 5; declares that x is a variable.

Problem 12. cout<< "k: " << x*5; will write:

Programs-

Problem 17. Write a program that converts a line of data containing three integers so that the data appears on three separate lines.

Problem 18. Write a complete program that reads three num- bers, adds 3.14 to each of them, and writes the result to the standard output stream if the result is greater than 10.

Reference no: EM13771084

Questions Cloud

Fossil fuels versus renewable energy : Discuss the scientific and technical concepts related to the uses of fossil fuels and renewable energy resources.
Critical characteristics of quality management : What are the critical characteristics of quality management? Discuss how quality management relates to safety. How do quality management and total safety management integrate to form the TSM model?
Drive an organizations strategic planning : Should technology drive an organization's strategic planning or should stratgic planning drive an organzationas technology adoption
Examine connection between stalking and domestic violence : In 2-3 pages, using your own words and APA formatting, examine the connection between stalking and domestic violence. Be sure to discuss the laws surrounding both of these issues and any difficulties that may arise in detection and/or prosecution
Write a program that converts a line of data : Write a complete program that reads three num- bers, adds 3.14 to each of them, and writes the result to the standard output stream if the result is greater than 10 - Write a program that converts a line of data containing three integers.
Safety and accident prevention : Explain the hazard analysis methodologies of FMEA, HAZOP, HEA, FTA and TOR. What do you feel are the most fundamental weaknesses of each of these methodologies? Why?
Write a persuasive research paper on immigration : Write a Persuasive and Argumentive Research Paper on Immigration.
Disease associated with poor nutrition : Identify health concerns or disease associated with poor nutrition with your stage.
Mining corporation purchased some production machinery : A mining corporation purchased some production machinery. It depreciated by SOYD depreciation. After 5 years of use, the company decided to sell the machinery.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Develop the logic for a program

The exact number of household records has not yet been determined, but you know that Marengo has fewer than 300 households. Develop the logic for a program that allows a user to enter each household size and dtermine the mean and median household ..

  Compare iso-iec outline with nist documents

Compare the ISO/IEC 27001 outline with the NIST documents outlined in 'Management of Information Security' (by Michael E. Whitman, Herbert J. Mattord).

  Write an analysis essays on oracle business intelligence

Write an Analysis Essays on Oracle Business Intelligence as an information system Platform, analyzing specific aspects of the system related to the concepts information management system.

  Standard analog-to-digital sampling rate in synchronous time

Iif synchronous time division multiplexing is used, along with standard analog-to-digital sampling rate, and each sample is converted into 8-bit value?

  What to consider before selecting product for system

National Information Assurance Partnership website, why is this not enough to just say "this product meets our security requirements"? Discuss what else you have to consider before selecting such a product for a system.

  Create a driver class to instantiates-updates several object

Create a driver class called FlightTest whose main method instantiates and updates several Flight objects. Two classes are required for this project: Flight and FlightTest.

  The types of information that should be placed in a table

The types of information that should be placed in a table

  How many ascii characters can be stored

How many ASCII characters can be stored - How many different values can be stored.

  An organization when data is compromised or lost

An organization when data is compromised or lost.

  Explain how the maxflow algorithm works

Explain how the maxflow algorithm works, elaborating on all cases and transitions that need to be considered during execution.

  Find a reported natural disaster that occurred in the past

See if you can determine how the plans helped the officials improve the response to the disaster. How do the plans help the recovery?

  Calculate how much bob gets as his session

calculate Alice's session key. Is Bob's session key the same as Alice's session key? Why or why not?

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