Question1: Consider the instruction: z = x % y. If x is 620 andy is 100, thenwhat is the variable z assigned with? [2 points]Answer:Question2: Which ones are valid comments. Circle your answer. [1point each]// This statements adds x and y Valid Invalid// *** Careful!!! Tricky calculation below *** Valid Invalid// Determine taxes // Valid Invalid/ Get name from user Valid Invalid\\ Get password from user Valid Invalid// Initialize sum with 20 before adding Valid Invalid///This is a comment Valid InvalidQuestion3: What is the value of x after all following statementsexecute? [2points]int x;int y;x = 92;y = 22;x = x * y;x = x * y;Answer:
Question4: Indicate whether the expression evaluates to true orfalse. Circleyour answer.x is 90, y is 2. [1 point each]x == 90 true falsex == y true falsey != 7 true falsey != 99 true falsex != y true falseQuestion5: What are logical operators? Explain each one with anexample. [4points]Answer:Question4: Indicate whether the expression evaluates to trueor false. Circleyour answer.x is 90, y is 2. [1 point each]x == 90 true falsex == y true falsey != 7 true falsey != 99 true falsex != y true falseQuestion5: What are logical operators? Explain each one with anexample. [4points]
Question1: Consider the instruction: z = x % y. If x is 620 and y is 100, then what is the variable z assigned with? [2
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am