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

  Access to the operating system''s application programming

When an individual, an application, or anotherprogram, through access to the operating system's application programminginterface (API), attempts to and/or gains access to an information assetwithout explicit permission or authorization to do so

  Explain order processing program to keep track

You're asked to implement an Order Processing program to keep track of orders for customers and process them if needed. The program will read a text file containing customer orders in arbitrary order and then process them Class Design

  What is a packet? what is packet switching

What is a packet? What is packet switching?How would you explain the concept of packet switching?What are the advantages and disadvantages of packet switching over circuit switching?

  Design a remote access control policy for richman

Richman Investments is an investment and consulting firm. The company wants to expand its business operations both in the U.S. and in foreign countries. It intends to eventually have 10,000 employees in 20 countries.

  Should you set in ta1ctl, and what corresponding

Which bits (including divisor bits) should you set in TA1CTL, and what corresponding countshould you set in TA1CCR0, to trigger an interrupt every 400 msec?

  Describe the organisational structure of your company

Describe the organisational structure of your company. Then formulate its mission. The mission should express all your above ideas in one sentence and Taylor-like methods are not applicable to software design and development processes.

  Identify the basic operation of the following algorithm

Identify the basic operation of the following algorithm (that takes as input an array A[0... n-1] of n integers) and analyze its worst-case time complexity.

  Create a narrative that describes site to prospective chat

Create a narrative that describes the site to your prospective client,Imagine that your narrative has been approved. Use Word, Visio, or Dia to

  Averages ten homework grades entered

Write a program that averages ten homework grades entered by the user. Allow for a bonus homework grade that can count as 5 extra points on their average. Create at least two functions (excluding main() ) in your program. In the first function, pr..

  A net-work technician for a global news service with 200

A net-work technician for a global news service with 200

  Finding slowest clock rate used and not lose any data

What is the slowest clock rate that could be used and not lose any data? Assume that the number of instructions to be processed for an interrupt is constant.

  Department of management information systems

Identify the benefits of using e-learning from the perspective of students of the first level in the Department of Management information systems.

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