// This program is supposed to display every fifth year
// starting with 2017; that is, 2017, 2022, 2027, 2032,
// and so on, for 30 years.
start
Declarations
num year
num START_YEAR = 2017
num FACTOR = 5
num END_YEAR = 30
year = START_YEAR
while year <= END_YEAR
output year
endif
stop
Fixed .code
start
Declarations
num year
num START_YEAR = 2017
num FACTOR = 5
num END_YEAR = 30
year = START_YEAR
while year <= END_YEAR
output year
year = year + FACTOR
endwhile
stop
If you have any query regarding the code please ask me in the
comment i am here for help you. Please do not direct thumbs down
just ask if you have any query. And if you like my work then please
appreciates with up vote. Thank You.
// This program is supposed to display every fifth year // starting with 2017; that is,...
// This program is supposed to display every fifth year // starting with 2017; that is, 2017, 2022, 2027, 2032, // and so on, for 30 years. start Declarations num year num START_YEAR = 2017 num FACTOR = 5 num END_YEAR = 30 year = START_YEAR while year <= END_YEAR output year endif stop What problems do you see in this logic? Show corrected pseudocode to fix the problems. Is there...
Find Bugs in the pseudocode// A high school is holding a recycling competition// This program allows a user to enter a student's // year in school (1 through 4)// and number of cans collected// Data is entered continuously until the user wnats to quit// After headings, output is four lines// one for each school year classstart Declarations num year num cans num SIZE = 4 num QUIT = 9 ...
write a LC-3 program
This program is supposed to set RO-1 if there's a 5 in one of ten memory locations, starting at x3100 Else, it should set RO to 0. R0 1, R1-5, R3 10 R4x3100, R2 MIR4] No R4 R41 R3 R3-1 R2 MIR4] Yes HALT Output the adress of the 5 to the console. The console should display A five found at x3107 (if the five is at x3107) If no five found, display No five found...
Turning this Pseudocode into the described C++ Program? (will include Pseudocode AND Description of the Program below!) Pseudoode: start Declarations num deptNum num salary num hrsWorked num SIZE = 7 num totalGross[SIZE] = 0 string DEPTS[SIZE] = “Personnel”, “Marketing”, “Manufacturing”, “Computer Services”, “Sales”, “Accounting”, “Shipping” getReady() while not eof detailLoop() endwhile finishUp() stop getReady() output “Enter the department number, hourly salary, and number of hours worked” input deptNum, salary, hrsWorked return detailLoop() if deptNum >= 1 AND deptNum...
the author's pseudocode
it follows this template
3 Design the logic for a program for Nos Encanta Tu Interés credit card company that a) Allows the user to enter their name, credit card number, beginning balane and monthly interest rate b) For the next full year (12 months), 1. Outputs the month number and the balance at the beginning of the month 2. Allows the user to enter the amount of their payment, and the amount of their purchases for...
// This application reads sales data for a real estate broker. // The user enters a record for each of 10 salespeople // containing the salesperson's name, // the number of properties sold by that person during the month, // and the total value of those properties. // The data records are sorted by value so the data for // the top three salespeople can be displayed. // Modify the program to // (1) enter data for any number of...
1. The table below
contains a program and a sample input, complete the table by
writing the output that will result from the input. [Be careful and
follow every line as it would execute on a
computer, don't assume you can just guess how the game works,
unless you do know snooker.]
2. List the counters
and accumulators (if any) in the program, briefly explain why you
think each is a counter or accumulator.
input:
O'Sullivan
red
green
red
pink...
The following files starts with some comments that describe
the problem comments are lines that begin with two slashes(//).
following the comments the file contains pseudocode that has one or
more bugs you must find and correct
Class Class 12. Debug (5 points) The following file starts with some comments that describe the prolblemcnpseudocode lines that begin with two slashes Un). Following the comments, the file that has one or more bugs you must find and correct. This Eile defines...
#include <stdio.h>
#include <sys/time.h>
#define DEBUG 1 //Constant is defined for true
int main()
{
struct timeval start,end; //to store time of starting and ending
of program
//if statement is added
if(DEBUG){
gettimeofday(&start,0);
}
printf("Time in microsecond for every second: \n"); //output
for(int i=0;i<100;i++) //outer loop to run 100 times
{
struct timeval loopstart,loopend; //to store time of starting
and ending of loop
//if statement added
if(DEBUG){
gettimeofday(&loopstart,0); //measuring time at start of
loop
}
for(int j=0;j<1000000;j++); //outer loop to...
1.An investment will pay you $500 every year starting 1 year from today and goes on forever. If the interest rate is 5% p.a., what is the maximum price that you would pay for this investment? 2.You are given $200 each year starting next year and finishing in 15 years (t=15). If the interest rate is 6% p.a., what is the maximum price that you would pay for these cash flows? 3.You borrow $100,000 today, the annual interest rate is...