Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program Challenge: To create a program that solves a series resistor circuit. Th

ID: 3576154 • Letter: P

Question

Program Challenge: To create a program that solves a series resistor circuit. The program should: Ask user to input a voltage that the circuit will operate at. s Ask user to input the number of resistors in the circuit, (max 50) Output total resistance, current, and power including the metric prefix. Output voltage drops, power dissipated including the metric prefix. Have three functions: current through, voltage drops, power dissipated across. Display three digits (ex. 22.3 mA) Display the omega, milli Amp. and Micro Amp symbols. Be able to grow and shrink based on how many resistors you:d for the circuit. Code must have comments on what is docs. Have a professional looking output display. You must also write an algorithm for the resistor project. '8' Extra points if you also include a flowchart. Example of algorithm: Insert function prototype for current through. voltage across. power .dissipated Declare integer number_ of_ resistors Set up array resistor with 50 elements Assign the symbols fur omega and micro to characters. Example of display output PLEASE SELECT WHAT MODE YOU WOULD LIKE TO DISPLAY? THEN PRESS RETURN. Enter '7' for Total resistance in circuit. Enter '2' for All resistors separately in circuit. Enter '.V for Circuit current. Enter '4' for Total Power Dissipated in circuit Enter '5' for Individual resistors with voltage drop across them. Enter '6' for Summation of circuit with power dissipation detailed. Enter '7' for Summation of circuit solved as a Parallel circuit. Enter '8' TO EXIT PROGRAM Summation of circuit with power dissipation was selected. The series current was 2.86 mA

Explanation / Answer

if (score >=0) then
if (score < 500) then
score = score + ten
end
end
scoreText.text = score
end
if (score < 0)
then scoreText.text = "You Lose!"
end
if (score > 499)
then scoreText.text= "You Win!"
end
end
-- known as once the bomb is broached by the player
-- [*fr1] the score as a penalty
local operate bombTouched(event)
if ( event.phase == "began" ) then
Runtime:removeEventListener( "enterFrame", event.self )
local blast = show.newImage( "ouch.png",event.x,event.y)
physics.addBody( blast )
event.target:removeSelf()
--divides score if game still live
if (score >=0) then
if (score < 500) then
score = scientific discipline.floor(score * zero.5)
  
scoreText.text = score
end
end
end
end
local operate superTouched(event)
if ( event.phase == "began" ) then
Runtime:removeEventListener( "enterFrame", event.self )
local blast = show.newImage( "boom.png",event.x,event.y)
physics.addBody( blast )
event.target:removeSelf()

--adds to attain if game remains going.
if (score >=0) then
if (score < 500) then
  
score = score + one hundred
end
end

scoreText.text = score
end
if (score < 0)
then scoreText.text = "You Lose!"
end
if (score > 499)
then scoreText.text= "You Win!"
end
end
-- Delete objects that has fallen off rock bottom of the screen
local operate offscreen(self, event)
if(self.y == nil) then
return
end
if(self.y > show.contentHeight + 50) then
Runtime:removeEventListener( "enterFrame", self )
self:removeSelf()
--takes off from score if game remains going
if (score >=0) then
if (score < 500) then
score = score - one
end
end
scoreText.text = score
if (score < 0)
then scoreText.text = "You Lose!"
end
if (score > 499)
then scoreText.text= "You Win!"
end
end
end
-- Delete objects that has fallen off rock bottom of the screen
local operate offscreenbomb(self, event)
if(self.y == nil) then
return
end
if(self.y > show.contentHeight + 50) then
Runtime:removeEventListener( "enterFrame", self )
self:removeSelf()
end
end
-- Add a replacement falling balloon or bomb
local operate addNewBalloonOrBomb()
-- you'll be able to realize red_ballon.png and bomb.png within the GitHub repo
if (score >= 0) then
if (score < 500) then
local startX = scientific discipline.random(display.contentWidth*0.1,display.contentWidth*0.9)
if(math.random(1,5)==1) then
-- BOMB!
native bomb = show.newImage( "bomb2.png", startX, -300)
physics.addBody( bomb )
bomb.enterFrame = offscreenbomb
Runtime:addEventListener( "enterFrame", bomb )
bomb:addEventListener( "touch", bombTouched )
else
if(math.random(1,5)==2) then
-- super!
native super = show.newImage( "super2.png", startX, -300)
physics.addBody( super )
super.enterFrame = offscreen
Runtime:addEventListener( "enterFrame", super )
super:addEventListener( "touch", superTouched )
else
-- Balloon
native balloon = show.newImage( "green_balloon.png", startX, -300)
physics.addBody( balloon )
balloon.enterFrame = offscreen
Runtime:addEventListener( "enterFrame", balloon )
balloon:addEventListener( "touch", balloonTouched )
end
end
end
end
end
-- Add a replacement balloon or bomb currently
--addNewBalloonOrBomb()

-- Keep adding a replacement balloon or bomb each zero.5 seconds
if (score >= 0) then
if (score < 500) then

timer.performWithDelay ( five hundred, addNewBalloonOrBomb, -1)

end
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote