Question
In JavaScript
This activity has two phases: 1. Discussion Phase: a. Agree on a time to meet with your group members online on Discord for discussion. b. Discuss with your group members in the appropriate Discord channel ex: (#group-a activity3-6) each of these questions. 2. Answering Phase: a. Navigate Canvas until you find Activity 3.6 submission located under Modules. Submit an answer to each of the questions mentioned below in the provided Text box individually. Use the following format for your answer submission on Canvas: Question 1: What is the value of this if statement condition: (a>b+? True or False? A program is given to you below. First, observe the program, but dont write anything just yet. This may look like the one from class, however it now has an else section added. This will change the way the
media%2Fda4%2Fda464654-7bd7-4332-ab3e-ce
media%2Fc14%2Fc14b32ed-d1fa-465c-930c-43
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question 1

The value is false. 5>4 is true. Note : b++ is a post-increment operator. b>a++ is true. But on negating the expression becomes false.

Question 2

c% 2 is zero. This means that c is false.

Question 3

Yes, there is a compile error. By default, the if statement takes only one statement. If we want multiple statements inside the if statement, we need to enclose it in a curly brace. Here we need to enclose the three print statements after the if statement inside curly brace to fix the compile-time error.

Question 4

There is no runtime error.

Question 5

The program runs after fixing the compile-time error as mentioned in Question 3. Yes , on changing the values a, b and c, a logical error would occur, if the ifelse statement is executed. This is because it is divide by zero error. We need to remove this statement from inside the if else statement to fix the error.

Question 6

Yes, the program is error free now.

Add a comment
Know the answer?
Add Answer to:
In JavaScript This activity has two phases: 1. Discussion Phase: a. Agree on a time to...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class...

    Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class header instance variable UML class diagram encapsulation client visibility (or access) modifier accessor method mutator method calling method method declaration method invocation return statement parameters constructor Goals By the end of this activity you should be able to do the following: > Create a class with methods that accept parameters and return a value Understand the constructor and the toString method of a class...

  • Clinical trials are usually conducted in phases that build on one another. Each phase is designed...

    Clinical trials are usually conducted in phases that build on one another. Each phase is designed to answer certain questions. Knowing the phase of the clinical trial is important because it can give you some idea about how much is known about the treatment being studied. There are pros and cons to taking part in each phase of a clinical trial. Phase I clinical trials: Is the treatment safe? Phase I studies of a new drug are usually the first...

  • java only no c++ Write a Fraction class whose objects will represent fractions. You should provide...

    java only no c++ Write a Fraction class whose objects will represent fractions. You should provide the following class methods: Two constructors, a parameter-less constructor that assigns the value 0 to the Fraction, and a constructor that takes two parameters. The first parameter will represent the initial numerator of the Fraction, and the second parameter will represent the initial denominator of the Fraction. Arithmetic operations that add, subtract, multiply, and divide Fractions. These should be implemented as value returning methods...

  • NEED HELP with HTML with Javascript embedding for form validation project below. I have my code...

    NEED HELP with HTML with Javascript embedding for form validation project below. I have my code below but I'm stuck with validation. If anyone can fix it, I'd really appreciate. ****************************************************************************** CODE: <!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <title>Nice</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> var textFromTextArea; function getWords(){ var text =...

  • As a continuation of the experiments in Question 1 you want to study the timing of...

    As a continuation of the experiments in Question 1 you want to study the timing of the APC's activity more distinctly. To do this you treat your cells with MG132 - a proteasome inhibitor. When MG132 is added to cells proteins can still be ubiquitinated, but they are not degraded, because the proteasome is inhibited. In cells that are treated with MG132 you can monitor APC activity on Cyclin B using just the cyclin B a. antibody and a western...

  • IN PYTHON Assignment Overview This assignment will give you experience on the use of classes. Understand...

    IN PYTHON Assignment Overview This assignment will give you experience on the use of classes. Understand the Application The assignment is to first create a class calledTripleString.TripleStringwill consist of threeinstance attribute strings as its basic data. It will also contain a few instance methods to support that data. Once defined, we will use it to instantiate TripleString objects that can be used in our main program. TripleString will contain three member strings as its main data: string1, string2, and string3....

  • Description 1. This project will create a base account class that has the members: std::string account_code;...

    Description 1. This project will create a base account class that has the members: std::string account_code; std::string first_name; std::string last_name; double balance; Provide a constructor that initializes ALL members in its initialization list with data passed in as arguments to the constructor. Provide any accessor functions you may need (e.g. to get the account code and balance and to set the balance). In addition, include two pure virtual functions that look like the following: virtual void monthly_update() = 0; virtual...

  • Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you w...

    Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you will build the below hierarchy: Overview: You will implement the supplier code: Shape, Square, TSquare, and Triangle, which will be used by the Homework7Main program. This program will use the DrawingPanel to draw these objects onto a canvas. Specification: You will take advantage of inheritance with using a super class, Shape.java. (below) Shape is an abstract class, which means it can be extended, but...

  • == Programming Assignment == For this assignment you will write a program that reads in the...

    == Programming Assignment == For this assignment you will write a program that reads in the family data for the Martian colonies and stores that data in an accessible database. This database allows for a user to look up a family and its immediate friends. The program should store the data in a hashtable to ensure quick access time. The objective of this assignment is to learn how to implement and use a hashtable. Since this is the objective, you...

  • python 11.8 Multiple committees The eventual goal of this assignment is to compute the total number...

    python 11.8 Multiple committees The eventual goal of this assignment is to compute the total number of ways of forming a collection of committees from an academic department of n professors. The first task is to write a function called committee to compute the number of ways of forming a single committee with members from a collection of n people. This is the same as compușing the number of ways of choosing r people out of n to sit at...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT