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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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