Design how to do the logic in your own words first

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

Objectives

- Gain experience with if, if else, and switch statements in C programs.
- Experience using % operator and true false logic.

Hints

This program will be MUCH easier if you design how to do the logic in your own words first. Do not even think about C until you understand the true false logic and the arithmetic needed to do it. Make sure you have a formula or a plan to calculate each case.

The program

The user types in two numbers to find if the first is evenly divisible by the second.

The program will output:
<first> is evenly divisible by <second>
Or
<first> is <value> too large to be evenly divisible by <second>. The closest number is <number>.
Or
<first> is <value> too small to be evenly divisible by <second>. The closest number is <number>.
Or
<first> is <value> off, in the middle from <lower number> or <larger number>

Examples:
User types 49 and 7.
49 is evenly divisible by 7.
User types 50 and 7.
50 is too large to be evenly divisible by 7. The closest number is 49.
User types 55 and 7.
55 is too small to be evenly divisible by 7. The closest number is 56.
User types 52 and 8.
52 is 4 off, in the middle from 48 or 56.

Rules:

You must use nested if, else if statements to do your logic.

The program must only return at one place, the bottom of main(), with no exit() and no break statements.

Rules for programming assignments

If you break any of these rules your will receive a 0 on your assignment and will have to rewrite it and resubmit.

1. All variables must be declared BEFORE ANY CODE.

2. No variables declared in loops like for(int x; The int x must be at the top of your code. See rule 1.

3. No use of break or continue in loops.

4. Functions that return a value must have one and only one return statement, the last line in the function.

5. All variable must have meaningful names. For rows and columns must be r and c or row and col or row and column. Not i, j, a, b or anything not meaning full.

6. Code must be properly indented and formatted.

7. All assignments must have comments at the top that:
a. Name of assignment, class, and the date.
b. Name of the author: that would be you

Reference no: EM131215870

Questions Cloud

How starbucks strategies have changed since its early days : Discuss how Starbucks' strategies have changed since its early days? Discuss how Dunkin' Donuts' strategies have changed since its early days?
Advantage to making lifetime transfer of property to donee : Which of the following is an advantage to making a lifetime transfer of property to a donee?
Examine the black box component : Link up two different signals by means of the mathematics component - for instance, addition or multiplication - and look at all three signals one below the other on the same screen.
Stockholders equity section of balance sheet : Stockholders’ Equity Section of Balance Sheet) The following is a summary of all relevant trans- actions of Vicario Corporation since it was organized in 2014. In 2014, 15,000 shares were authorized and 7,000 shares of common stock ($50 par value) we..
Design how to do the logic in your own words first : Design how to do the logic in your own words first. Do not even think about C until you understand the true false logic and the arithmetic needed to do it. Make sure you have a formula or a plan to calculate each case.
Do you think we have become a culture of photographs : How has the ability to take a photograph changed from Daguerre to today (with phones)? Do you think we have become a culture of photographs? How?
What do you advise burt about the validity of his agency : What do you advise Burt about the validity of his agency agreement with Amy and why? Explain your rationale in detail. What do you advise Burt about Tours' authority to make reservations/contracts on his behalf and why?
How to set the block format and the sample frequency : Find out how to set the block format and the sample frequency in the menu (A/D). What exactly do these two quantities indicate?
Reason person would prefer to be independent contractor : Which of the following is a reason a person would prefer to be an independent contractor?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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