Write a c program that reads an integer entered by the user

Assignment Help C/C++ Programming
Reference no: EM13963156

1-Write a C program that asks the user to enter a U.S dollar amount and then shows how to pay that amount using the smallest number of $20, $10, $5, $1, quarters, dimes, nickels, and pennies.

For example:
Enter a dollar amount: $78.49
$20 bills: 3
$10 bills: 1
$5 bills: 1
$1 bills: 3
Quarters: 1
Dimes: 2
Nickels: 0
Pennies: 4

2- Write a C program that reads an integer entered by the user and displays it in octal (base 8). The output should be displayed using five (5) digits, even if fewer digits are sufficient. Hint: To convert a number to octal, first divide it by 8; the remainder is the last digit of the octal number. Then divide the quotient by 8 and repeat the process to arrive at the next digit. (Do not use built-in C function to solve this problem. You must code it).

For example:
Enter a number between 0 and 32767: 2016
In octal, your number is: 03740

Reference no: EM13963156

Questions Cloud

Evaluate the effectiveness of previous marketing : Evaluate the effectiveness of previous marketing and positioning strategies of your chosen organisation to determine their effectiveness -  Identify and briefly discuss your chosen organisation's direction and marketing targets.
What is the rms value of the displayed signal : b) What is the value of the ac power that can perform the same amount of work as a 24 dc 0ne ?
Bonds to react to the announcement : RJR Nabisco also had $10 billion in bonds outstanding at the time of the dividend increase in Problem 1. How would you expect the bonds to react to the announcement? Why?
Estimate the number of meters in one light year : What's the difference between a logarithm of a product and the product of logarithms? Can you provide a simple example for each. Can you also be very detail in explaining the difference. I would really like to understand this more.
Write a c program that reads an integer entered by the user : Write a C program that reads an integer entered by the user and displays it in octal (base 8). The output should be displayed using five (5) digits, even if fewer digits are sufficient.
How you would integrate the data on the payscale website : Using external resources to gauge compensation levels may result in more equitable compensation planning. From the e-Activity, assess how you would integrate the data on the PayScale Website or similar sites into your compensation planning. Specif..
Revenues and earning dropped significantly : WeeMart, a retailer of children's clothes, announces a cut in dividends following a year in which both revenues and earning dropped significantly. How would you expect its stock price to react? Explain.
What is this critical speed : However, if you are going faster than a certain critical speed, there are some distances from the light for which you cannot do either (i.e. you are too far to make it through, and yet too close to stop). What is this critical speed?
Write a short paper on the network components : Perform research and write a short paper on the network components that make up a local area network.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Imagine a circular linked list of integers and explain it

imagine a circular linked list of integers that are sorted into ascending order as shown in the attached file. The external pointer list points to the last node, which contains the largest integer.

  Viewer features of the application

Sharon has started to use both the stock details management and the file information viewer features of the application. However, while using the file information viewer application, she accidentally enters the path of a folder that does not exist..

  What value will be printed in the code

In the following code snippet, what value will be printed for c and d before the loop is executed

  Write a test program that creates an account object

Write a test program that creates an Account object with an ID of 1122, a balance of 20000USD, and an annual interest rate of 4.5% - Use the withdraw method to withdraw 2.500USD, use the deposit method to deposit 3000USD and print the balance, mont..

  Saddle point is an element

For a square nXn a array, a saddle point is an element that is the maximum in its row and the minimum in its column.

  Displays columns titled "name", "quantity", "price", value

Write a program that displays columns titled "Name", "Quantity", "Price", and "Value". The fourth column contains the result of multiplying each item's quantity by its price. In addition, the program should calculate and display the total value of th..

  Program that stores information for date-time objects

Derive class WeekDay from class DateTime such that WeekDay::display() will display local date time using values from the parameters and the corresponding weekday.

  Differences of absorption and variable costing

Discuss the advantages and disadvantages of absorption and marginal costing and what factors organisations are required to consider when using each of these methods

  Code for the process management simulation

Its C++ in a linux environment for Process Management Simulation

  Evaluate the circumference of a circle

Write a program that will call a function to calculate the area of a circle, and call another function to calculate the circumference of a circle.

  Define and implement a default constructor for robot class

Define and implement a default constructor for the Robot class that sets the locations to zero, and load to false (no load is being carried by the Robot)

  Three dimensional array representing parking spaces

start with code in the file lab.cpp. This program works with a three dimensional array representing parking spaces in a parking garage on several floors. The code is incomplete. The functions "main", "display" and "showSpace" are complete. Your job i..

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