Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a RURPLE program that will print out the result of adding numbers together. The numbers will be specified by dropping beepers into the world.

image text in transcribed

Create a RURPLE program that will print out the result of adding numbers together. The numbers will be specified by dropping beepers into the world. Each stack of beepers represents one digit in a number. The numbers will be on each row of the world. There will be no blank rows. There will never be any beepers in the left most column (the one where the robot starts). For example, here is a world with five numbers in it: 1 2 3 4 5 6 7 8 9 10 Avenue The robot would need to figure out what each number was, and display the result using a print command. In this world, the result would be 18+37+2+30+12, for a total of 99 Requirements Create a defined command that will add up the total number of beepers on the robot's current row. The command should return the value of the number on that row. The general approach should be to move all the way to the far wall, and start picking up beepers on the right end of the number. Those beepers are the ones digits, so each beeper counts as just 1. The next digit to the left counts as the tens, then the one hundreds, etc. Keep going until you get back to the left wall. This will require some thought about your coding, and about using variables. We will go through the concepts of the algorithm in class, but you will have to fill in the details and code it yourself Call that defined command for each row, adding the result to a running total. At the end, print out the running total

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions

Question

What is management growth? What are its factors

Answered: 1 week ago

Question

1. Which position would you take?

Answered: 1 week ago