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

  Concept and include strengths and weaknesses of papers

Analyse those papers and make a document with usual report format such like Abstract, Introduction, body, conclusion and references and also appendix.

  Town has two burger restaurants located across the street

A small midwest town has two burger restaurants located across the street from each other: 'Burgerama' and 'The Burger Brothers'. As both restaurants compete for the same customers, they are both considering offering a larger burger with more topping..

  Calculate and display the total income of the abc car shop

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified. Some examples of pseudocode can be found at http://www.unf.edu/~broggio/cop2221/2221pseu.htm.

  Information security management and framework choice

What are the major perspectives to consider in information security management and framework choice

  Find the sum of a fibonacci series upto n terms

Find the sum of a Fibonacci series upto n terms, where n is the input of a Matlab program using for loop. First term i.e. F1=1 and Second term F3=1.uestion here

  Pipelined machine versus the single cycle machine

What is the speedup of the pipelined machine versus the single cycle machine assuming there are no stalls?What is the speedup of the pipelined machine versus the single cycle machine if the pipeline stalls 1 cycle for 30% of the instructions?

  Write a menu-driven multiform inventory program

Write a menu-driven multiform inventory program for a bookstore with data saved in a text file. Each record of the text file should consist of 5 fields-title, author, category (fiction or nonfiction), wholesale price, and number in stock.

  Discuss some key characteristics of load lines

Explain the key quantities from the data sheet of your selected transistor. Based on your selected data sheet, what are the most important quantities to be considered for a circuit designer, and why. Discuss some key characteristics of "load lines,..

  Create a class that simulates an alarm clock

create a class that simulates an alarm clock. In this class you should *store time in hours, minutes, and seconds. Note if time is am or pm. (hint: you should have separate private members for the alarm and the clock.

  Which of the following are advantages of the osi model

The OSI model was designed to provide a framework for networking and internetworking standards. Which of the following are advantages of the OSI model?

  Describing fields and options with user account set-up

Describe the fields and options associated with user account set-up.

  Study evidence for defence in law firm

You are engaged by law firm to study evidence for the defence. You uncover evidence that doesn't help your client's case but was not discovered by the prosecution.

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