Question

Question 6) Thrown for a Loop. What is the exact output of the following pseudocode program?...

Question 6) Thrown for a Loop.

What is the exact output of the following pseudocode program?

BEGIN MAIN
CREATE num1 ←15

CREATE num2 ← 30

FOR each I from 1 to 4 by 1
    IF (num1 == num2) THEN
        PRINT(“lime” + ”\t”)

      ENDIF
      PRINT("lemon” + “\t”)
      num1 ←num1 * 2
      PRINTLINE("apple” + “\t”)

END FOR
PRINTLINE(“orange”)

END MAIN

Output=

Question 5) Order Up!Each operator below has a box under it.  Fill in the order of how the following expressions are evaluated by the computer as an Integer, as well as the solution for the equation. (15 points)

Part 1:      ( ( 8  /  3)   -   1)       *     (6 + 3)    -   4 Solution

                                                                                        

Part 2:       3   *   6   -   5   /   3 Solution

         

Homework Answers

Answer #1

Order:

1) 8/3

2)(2-1)

3)(6+3)

4)1*9

5)9-4

Part 2 order:

1)3*6

2)5/3

3)18-1

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
1. Create a new project. Type in the following program. Add a comment at the top...
1. Create a new project. Type in the following program. Add a comment at the top to include your name and the date. 2. Compile and Run with different values. What data values should you choose? Think about what we discussed in class. 3. Add code to compute the modulus. Hint: you will also have to declare a new variable. //this program demonstrates the use of various operators #include <iostream > using namespace std; int main() { int num1; int...
Question 6 uses a 4-bit "counter" that outputs the following repeating pattern: 14, 9, 11, 1,...
Question 6 uses a 4-bit "counter" that outputs the following repeating pattern: 14, 9, 11, 1, 4, 2, 12, 5, 10, 15, 0, 3, 6, 13, 7, 8, ... Create a state table for your transitions. Use the convention of S for starting states and N for next states. Create the Karnaugh maps and the minimal expressions for next state of each bit.
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF A RUNNING COMPILER QUESTION: 1) Fibonacci sequence is a sequence in which every number after the first two is the sum of the two preceding ones. Write a C++ program that takes a number n from user and populate an array with first n Fibonacci numbers. For example: For n=10 Fibonacci Numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 2): Write...
Program will allow anywhere between 1 and 6 players (inclusive). Here is what your output will...
Program will allow anywhere between 1 and 6 players (inclusive). Here is what your output will look like: Enter number of players: 2 Player 1: 7S 5D - 12 points Player 2: 4H JC - 14 points Dealer: 10D Player 1, do you want to hit? [y / n]: y Player 1: 7S 5D 8H - 20 points Player 1, do you want to hit? [y / n]: n Player 2, do you want to hit? [y / n]: y...
##4. What will the following program display? ##def main(): ## x = 1 ## y =...
##4. What will the following program display? ##def main(): ## x = 1 ## y = 3.4 ## print(x, y) ## first printing ## change_us(x, y) ## print(x, y) ##second printing ## ##def change_us(a, b): ## a = 0 ## b = 0 ## print(a, b) ## ##main() ## ##Yes, yes, main() displays ##1 3.4 ##0 0 ##1 3.4 ## The question is: why x and y are still the same while the second printing of (x,y)? ## It seems...
What is the output of the following Java program? public class Food {     static int...
What is the output of the following Java program? public class Food {     static int count;     private String flavor = "sweet";     Food() { count++; }     void setFlavor(String s) { s = flavor; }     String getFlavor() { return flavor; }     static public void main(String[] args) {         Food pepper = new Food();         pepper.setFlavor("spicy");         System.out.println(pepper.getFlavor());     } } Select one: a. sweet b. 1 c. The program does not compile. d. 2 e. spicy...
Question Rewrite the following C program using switch-case statement. and give me an output please use...
Question Rewrite the following C program using switch-case statement. and give me an output please use printf and scanf #include<stdio.h> int main(void) {      int semester;           printf("What is your Studying Level (1-8)?> ");      scanf("%d" , &semester);      if(semester == 1 || semester == 2)           printf("Your are a freshman!\n ");      else if(semester == 3 || semester == 4)           printf("Your are sophomore!\n ");      else if(semester == 5 || semester == 6)           printf("Your are...
Predict the output from the following program. Select all lines of output that are produced by...
Predict the output from the following program. Select all lines of output that are produced by this program. If there are computed values in an output line, you must select the line with the correct value as computed by the program. public class WalkToSchool20 {         public static void main (String[] args) {                 Pedestrian p1 = new Pedestrian ( 1 );                 Pedestrian p2 = new Pedestrian ( 2 );                 Pedestrian p3 = new Pedestrian ( 3 );...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue...
QUESTION 1 What does the following code segment output? int red, blue; red = 7; blue = red + 2 * 5 red++; blue = blue + red; cout << blue; 4 points    QUESTION 2 Is the following statement true or false? The Boolean expression in the following if statement will be true for all values of x in the range from 10 to 20 (including the endpoints) and false for all other values: int x; if (x >=...
The program shown below reads in (N) values of time (hours, minutes, and seconds). If the...
The program shown below reads in (N) values of time (hours, minutes, and seconds). If the values for hours, minutes and seconds are a legal military time (i.e. 00 00 00 to 23 59 59) the program should display the formatted results (i.e. 12 34 56 should be displayed as 12:34:56). If there's an error for any of the entered values, an exception should be thrown and an error message should be displayed. Note, there are three exception conditions, one...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT