Compare the values of adding the numbers to multiplying

Assignment Help Python Programming
Reference no: EM132360852

Question

A program that adds the numbers 1/2 to itself and 1/3 to itself a large number of times. It is to then compare the values of adding the numbers to multiplying 1/2 and 1/3 times the number of times they were added.

The program must first add 1/2 and 1/3, and compare to the value obtain using multiplication instead of addition. It is to do this for the following values:

1,000

10,000

100,000

1,000,000

10,000,000

100,000,000

1,000,000,000

The program should do this using two nested loops. The outer loop determines the number of times to add and starts at a 1000 and increments by multiples of 10 up to a 1,000,000,000.

The inner loop does the addition of the numbers 1/2 and 1/3. When the inner loop completes, output the two sums (the ½ and the 1/3) and the two products, and the differences and continue the outer loop. Remember to clear your variables for the sums (accumulators) before the start of the inner loop.

Reference no: EM132360852

Questions Cloud

Describe the endocrine system in brief : Write 1 and 1/2 pararaphs explaining the following conditions that pertain to EACH body system. (Each one should include the following information below).
Describe example of very poorly implemented database : Describe an example of a very poorly implemented database that you've encountered (or read about) that illustrates the potential for really messing things up.
Compute the product of two polynomials : Write a program which computes the product of two polynomials. Polynomials should be input as lists; Explain how the program works.
Write about neural birth defects : Complications of High Risk Pregnancy. Write about Neural Birth Defects. What symptoms support the diagnosis of moderate persistent asthma in a child over 5 year
Compare the values of adding the numbers to multiplying : Compare the values of adding the numbers to multiplying 1/2 and 1/3 times the number of times they were added.
Job described in ad you targeted in your budget assignment : Using job described in ad you targeted in your budget assignment, pretend you already interviewed with the supervisor and write a thank-you letter in response.
Describe the concept of behavioural assessment : 1. Identify five (5) style essential components of a personal development plan. 2. Describe the concept of 'behavioural assessment' in a workplace context.
Find all the prime numbers between 2 and n inclusive : For this problem you will find all the prime numbers between 2 and N inclusive. A number is prime if it is only evenly divisible by itself and 1.
Review erik approach to the after action review : Erik new that there were different techniques to use when conducting learning activities for groups rather than individuals. Occasionally he had to assist on a

Reviews

Write a Review

Python Programming Questions & Answers

  Scene recognition using object detection

Using the images and their annotations (dataset will be provided by me), train the capsule neural network, Fast-RCNN, Faster RCNN and Mask RCNN

  Create an autopsy data ingest module

Create an Autopsy Data Ingest Module, using python 2.7, that runs cipher.exe (cipher /u /n /h) - Finding Encrypting File System (EFS) files

  Write a function to evaluate returns the area

Write a function called area_triangle() that takes the height and width of a triangle and returns the area

  Write a recursive function called binary search

Write a recursive function called binary_search() that accepts as arguments a number - Write a function decimal() that accepts as input an integer denominator

  Construct a python function named finder that takes two

Construct a Python function named finder that takes two string parameters, needle and haystack. Your function should find the first.

  How many rabbits and how many chickens do we have

We count 35 heads and 94 legs among the chickens and rabbits in a farm. How many rabbits and how many chickens do we have?

  Write a function that accepts a single list argument

Write a function that accepts a single list argument. Your function must return the longest increasing sequence of numbers present in the argument list.

  Produce the simulation of the orbits of the planets

Need to produce a code with object oriented programming using python, which will produce the simulation of the orbits of the planets around the sun

  Create a simple rental car billing calculator

Your task for is create a simple rental car billing calculator. This script also emphasizes importance of using and modifying variables

  Most popular name would be the one with the biggest number

the program will ask you to insert the year that the user is interested in, then ask the gender that the user is interested in, and print out the most popular names corresponding to the year and gender. FYI, the number on the right represents how man..

  Construct function that will evaluate arithmetic expression

Construct a python function named calc that will evaluate a simple arithmetic expression. The input to your program will be a string of the form.

  Create three dictionaries and times and rooms and instructor

Write down the start time, room, and instructor for each class In Python create three dictionaries, times, rooms, and instructors

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