SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 13 Nov 2017 My Price 10.00

calculate the problem and stop after the condition has been met.

I'm trying to write this problem, but when I run it nothing seems to happen. I've attached the python solution to problem 1. Just want to know what I am missing.

 

2.  Problem 1: Write a program that will calculate the problem and stop after the condition has been met. 

 

a=number of loops (start with zero but will increase by 1 after each completed loop)

b=a+1

c=a+b

 

a=1
b=a+1
c=a+b
while (c<=5):
      a=1
      b=a+1
      c=a+b
print("Loop had executed " + str(x) + " times")


#a is assigned value 1
#b is assigned value a+1
#c is assigned value a +b. That is c =a +b.
#The condition is checked if c is smaller than 5 the same procedure
#begin again and if c is greater than 5 loop will terminate.
#Only one loop is enough to complete this task.
#Only one loop is required to iterate all 3 statements again and again.
 

Condition: If c is less than 5, then the loop will continue; else, it will end.

3.  Print a string variable that states the number of loops required to meet the condition for Problem 1.

Answers

(5)
Status NEW Posted 13 Nov 2017 02:11 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)