1. What are the problems with the following pseudocode? Be
careful here, this one is tricky!
Module main()
Number siblingAge = 12
Display “your “+siblingType+ “ has”
yearsUntilAdult(siblingAge)
Display “years until they are an adult”
End Module
Module yearsUntilAdult(Number inAge)
Character siblingType = “sister”
If inAge < 18 Then
Display inAge - 18
Else
Display 0
End If
End Module
A. yearsUntilAdult module call can not see variable siblingAge so siblingAge can not be used as input into the module call
B. yearsUntilAdult would have displayed wrong value(logical error)
C. scope of siblingType variable is restricted to within yearsUntilAge so main() can not display the value of it
D. yearsUntilAdult module requires different datatype as an argument than what is used in method call within main
There can be multiple answers!

B. yearsUntilAdult would have displayed wrong value(logical error) C. scope of siblingType variable is restricted to within yearsUntilAge so main() can not display the value of it
1. What are the problems with the following pseudocode? Be careful here, this one is tricky!...
5. Select the problems with the following pseudocode. Be very careful again here and make sure you understand local variables and scope. You can start by tracing from the Main method. Module Main() Display “welcome to the csc-115 pizza shop!” Menu() Display “you ordered a “+ pizzaChoice+ “ pizza” End Module Module Menu() String pizzaChoice Display “please enter what kind of pizza you want: “ Input pizzaChoice Display “Are you sure? Please enter your pizza choice again” String pizzaChoice Input...
Given the following pseudocode, what is the value of myGrade after the call to the curveScore module? Module main() Declare Integer myGrade Set myGrade = 82 Call curveScore(myGrade) End Module Module curveScore(Integer score) Declare Integer newScore Set newScore = score + 5 Display newScore End Module Group of answer choices : A. 87 B. can not tell C. 82 D. 5
1. In this example, we have some modules that are defined in a way that specifies no inputs. This is not something you will commonly see because many times our modules perform some intermediary processing for our overall task along with the fact that we'd like to reuse our modules. For this problem, select the variable names that would be able to successfully linked to a value and have no conflicts. Be thinking about the scope of the variables. Module...
Look at this partial class definition, and then answer questions a - b below: Class Book Private String title Private String author Private String publisher Private Integer copiesSold End Class Write a constructor for this class. The constructor should accept an argument for each of the fields. Write accessor and mutator methods for each field. Look at the following pseudocode class definitions: Class Plant Public Module message() Display "I'm a plant." End Module...
Requirement Write pseudocode and translate it to ONE C-program for each the following problems. In your pseudocode and C-program, use only what you have learned in this class so far. (Menu) Design a menu for question 2 and 3. So far, you use one program to solve all lab questions. But some of you may feel awkward when you want to demo/test only one lab question. To overcome that, your program should show a menu so that the users of...
Create qz5.c to include all of the following function prototypes: void check1(char *, char, int *); void check2(char *, char, int *); void display(char, int); Then, implement main() to perform the tasks below: Define a 10-element char array with initial values of any lower case letters of your selection. Values can duplicate. Define a pointer that points to the above array. Print the array completely with double spaces before each character. See screenshot below for a sample. Call check1() with...
This code should be in C please!! Your file should meet the following criteria: • Function prototype and implementation for a calculateDivisors function that takes in an integer parameter, calculates the sum of its divisors, and returns that sum (as an integer value) • A structure that represents what is represented on each line of output, e.g., o Line number o Sum of the divisors for that line number o Character array containing “Perfect”, “Deficient”, or “Abundant” • Pointer declared...
Python Programming Chapter 5 Programming Exercise Dinner Selection Program (60 points total) Pseudocode (10 points) As the family cook, you know that the toughest question of the day is "What's for dinner?" You For decide to write a program to help you do days of meal planning for the entree, side and dessert. You will need to use random numbers and functions to complete the project. What's Dinner? • • • Start with a pseudocode (10 points). Write the pseudocode...
Write a complete MIPS assembly language program that implements the following pseudocode. program h2 define global integer variables w, x, y, z -- in the .data section function main() SysPrintStr("Enter an integer >= 0 for w? ") w ← SysReadInt() SysPrintStr("Enter an integer >= 0 for x? ") x ← SysReadInt() SysPrintStr("Enter an integer < 0 for y? ") y ← SysReadInt() z ← 16(w + x) - (3 × -y mod 7) SysPrintStr("z = ") SysPrintInt(z) SysExit() end function...
Questin 1 (CO 2) Which of the following is not a valid name in python? last_name lastName last name lname Question 2 (CO 3) How many times will “Hello World” be displayed after the following code executes? num=2 while num<12: print("Hello world") num+=2 2 12 5 4 Question 3 (CO 1) The following code contains an error, what type of error is it and what line number is it? 1 count=1 2 while count<4 3 print("count = ",...