Observe the following switch statement: switch (prompt("What is your mood today?")) { case "happy!": console.log("Yay!"); break; case "Sad".toLowerCase(): console.log("Don't be sad..."); case "upset": console.log("Get glad!"); break; case "UNKNOWN": console.log("How do you not know?"); default: console.log("Are you human?"); break; } Question 1: If input is "happy!" What is the output? Question 2: If input is"Sad" what is the output? Question 3: If input is "UNKNOWN" what is the output?
Q: What is live streaming on social media and how does it work?
A: Introduction: The continuous collection and transmission of internet streaming material in real-time…
Q: Does it calculate how many computer instructions are needed to execute each statement at the source…
A: Introduction: A computer's CPU is its beating heart. A programme is nothing more than a collection…
Q: Block Ciphers are a class of Encryption Algorithms. Describe Block Cipher in your own words and…
A: Answer
Q: write a C++ program to read N numbers; find the a nearest larger number of X by using a binary…
A: The answer is given in the below step
Q: sorting algorithms. You need to show at least two examp implemented. 1. Selection Sort (10 elements)…
A: Sorting algorithm 1) selection sort Heap sort 2) insertion sort Merge sort Quick sort…
Q: Implement the function of modulus operator. Don't use the inbuilt function. Programming language:…
A: Required: Implement the function of the modulus operator.Don't use the inbuilt function.Programming…
Q: 1 4 2. 3 4 2 3 1.
A: User wants to output this pattern 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
Q: Give a brief summary of the benefits and drawbacks of employing connectionless protocols rather than…
A: Introduction: A connectionless protocol is used to describe communication between two network…
Q: Given the above table: Assuming unsigned 4-bit representation of numbers, under what conditions…
A: Given that, The table contains two values A and B and their sum in both binary and decimal form. The…
Q: If you are the network administrator for a university, choose the proper NAT method. Explain why you…
A: Introduction: When a packet is in transit through a traffic routing device, network address…
Q: How can forensic investigators obtain data from Windows-based PCs that is both volatile and…
A: Introduction: The evidence is mainly stored on computer hard drives, and the data gathered from…
Q: Using Matlab, write a program to define the function by the user to find the smallest number in the…
A: Code: n=input('Enter n: ') c=zeros(1,n); for i=1:n c(i)=input('enter the %d\n th value',i)…
Q: In generalized forwarding what is the purpose of having the priority section
A: Generalized forwarding is when a router forwards based on header field values.Software defining…
Q: Explain what one might do to reduce the amount of time it takes to compile the monthly sales report…
A: Introduction: Explain what one might do in database management to lessen the time it takes to create…
Q: How to prove that the language {am bn cp | m,n,p are greater than or equal to zero and m != n and…
A: We are going to prove that the language {am bn cp | m,n,p are greater than or equal to zero and m !=…
Q: 3. The truth table of the priority encoder has been given below: Inputse Outputs D3e D2 D1 D0 Ale Ve…
A:
Q: Write an assembly language program that evaluates the polynomial: y = ax 3 -bx 2 + cx -d for x…
A: ANSWER:-
Q: Briefly discuss appropriate technology. Determine and describe how a specific piece of relevant…
A: Appropriate technology (AT) is technology that is designed to be "appropriate" to the context of its…
Q: write a C++ program to read N numbers; find the a nearest larger number of X by using a binary…
A: The code is given in the below step
Q: Write a function that takes one double parameter, and returns a char. The parameter represents a…
A: CPP Code: /****************************************************************************** Welcome to…
Q: Create an array of months of year, name it Days, and initialize it with month of the year: 1)- find…
A: We have shared the code below with above instructions , Code is in C++ , Dev c++ Firstly, an array…
Q: •Draw a class diagram corresponding to the following situation: •An organization has three…
A: below is the class diagram:
Q: When perusing the web, you come across some weird data on a seemingly secure website, and you…
A: Introduction: A digital certificate might be used to authenticate users on the internet.It verifies…
Q: What is the purpose of having so many separate components in an operating system?
A: Introduction: Operating System An operating system is a software programme that manages the…
Q: Write a Python program to find the string trom the user entered list. You have to take the list of…
A: - We need to code a python program to find a string in a list.
Q: What are the benefits and drawbacks of using a distributed database management system?
A: Introduction: Better Response If data is disseminated efficiently, user requests may be fulfilled…
Q: What negative impact did WannaCry (ransomware) have on its victims and their systems?
A: Ransomware is the one of the malware designed to deny a user or organization access to files on…
Q: If ASCII “A” and “a” are combined into a 16-bit pattern and then appended with a FCS (Frame Check…
A: A very powerful but easily implemented error detecting technique is cyclic redundancy check (CRC).…
Q: When and for how long should a network change be scheduled?
A: Introduction: We all know that a network is a means for communication between devices or for data…
Q: Which of the following is true? a. C++ is c+2. b. The arithmetic operators * and / are equal. O an…
A: This question argues about which of the following is true? a. C++ is c+2. b. The arithmetic…
Q: C++ Program to create an output like this using loops
A: Here I have created an outer loop to execute 5 times. Inside the loop, I have created another loop…
Q: Simplify using the Logical Equivalence Laws or Algebra of Propositions 21. (~(P ^ S) v ~Q) ^ (P v…
A: The answer is given below.
Q: Implement a spanning tree algorithm using C++. A spanning tree is an acyclic spanning subgraph of…
A: Implementation of spanning tree algorithm using c++
Q: When it comes to microprocessor systems, what are the various sorts of interrupts?
A: In a microprocessor systems, There are two main types of interrupts.
Q: Analyze the time complexity of some basic algorithms in terms of Big-O
A:
Q: Prove (using the concept of interpretations and the value of a formula under v1 an interpretation I)…
A: Below is the answer to above question. I hope this will be helpful for you...
Q: What are the benefits and drawbacks of using a distributed database management system?
A: Answer
Q: 1-Translate the following C programs to MIPS assembly program (Please explain each instruction in…
A: #here are all the comment outputs. .LC0: .string "\n please enter number of elements in an…
Q: LWC Assignment: Create a LWC component to display the output. You can create the dummy data in JS…
A: Create a LWC component to display the output. You can create the dummy data in JS file.
Q: It's unclear what causes software to degrade rather than wear out.
A: Software is “never-ending”. It takes the form of a curved curve. An undiagnosed disability will…
Q: Write a Python program to take a string and an int n from user, print a string made of the first and…
A: Required:- Write a Python program to take a string and an int n from the user, and print a string…
Q: Arduino
A: Answer is in given below:-
Q: LWC Assignment: Create a LWC component to display the output. You can create the dummy data in JS…
A: Intro To LWC: LWC is a stack of modern lightweight frameworks built on the latest web standards. It…
Q: Explain what one might do to reduce the amount of time it takes to compile the monthly sales report…
A: Explain what one might do to reduce the amount of time it takes to compile the monthly sales report…
Q: Examine the benefits of agile development vs more conventional development approaches.
A: In the software sector, every company is engaged in a number of different projects and produces a…
Q: Write a program that uses radio buttons to select background colors for text. The available colors…
A: Answer
Q: What is live streaming on social media and how does it work?
A: Solution - In the given question, we have to tell what is live streaming and how does it work.
Q: 4. IP Security operates in which layer of the OSI model? A. Network Layer B. Transport Layer C.…
A: As per our guidelines we are supposed to answer three questions. Kindly repost other questions as a…
Q: The Super Spy Read This Carefully!! (For your eyes-only) Your task, should you choose to accept it,…
A: Here is the approach : Create method to encrypt the message . Create one variable to store the…
Q: When it comes to computers, what is a "system?"
A: Introduction: An operating system is a software that acts as a bridge between the end user and the…
Observe the following switch statement:
switch (prompt("What is your mood today?")) {
case "happy!":
console.log("Yay!");
break;
case "Sad".toLowerCase():
console.log("Don't be sad...");
case "upset":
console.log("Get glad!");
break;
case "UNKNOWN":
console.log("How do you not know?");
default:
console.log("Are you human?");
break; }
Question 1: If input is "happy!" What is the output?
Question 2: If input is"Sad" what is the output?
Question 3: If input is "UNKNOWN" what is the output?
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
- - Challenge Activity 1: Stadium Seating Revenue Calculation Tool There are three seating categories at a stadium. Class A seats cost $20, Class B seats cost $15, and Class C seats cost $10. Write a program (a GUI program) ON *PYTHON*that asks how many tickets for each class of seats were sold, then displays the amount of income generated from ticket sales.Java Program - GUI Number Guessing Look at the code, notice that the actionPerformed method is not complete. It just contains code that will print to the console when buttons are pressed. Make the following modifications to the code. When the Higher button is pressed invoke this.guesser.higher(), and then put the new guess into the this.guessField When the Lower button is pressed invoke this.guesser.lower() and then put the new guess into the this.guessField When the Reset button is pressed, invoke this.guesser.reset() and then put the new guess into the ghis.guessField When the Correct button is pressed, exit the app using System.exit(0). Wrap the invocation of lower() and higher() in try catch blocks that catch NumberGuesserIllegalStateExceptions. Show a JOptionPane that alerts the user that you are onto their schemes. Change the guessing algorithm from random-guess to binary search. You can do this by changing the object created for the guesser to a plain old NumberGuesser. It…Create a card game in which the dealer shuffles the deck and deals 13 cards to the player. The player sorts her hand and says whether it includes the King of Hearts. Repeat 4 times so all the cards are dealt eventually. Internally, the player should return true or false without writing to the console. In response, the dealer should write on the console, "You won!" or "You loose again."
- Add additional functionalites to this code. For one room add this riddle, "The shorter I am, the bigger I am. What am I?" And the only way to continue to the next room is to type, "A temper," or "temper." And for another room, a help command. For example, the user will type, "help," and they will be told where to go next so they can each the winning room.In c Hangman gameWrite a terminal based on the game of Hangman. In a hangman game, the player is given a wordthat they need to guess, with each letter of the word represented by an underscore/blank. Theplayer tries to guess a letter of the word by entering it into the terminal. If the letter is correct, theblank corresponding to that letter is filled in. If the letter is incorrect, a part of a stick figure isdrawn. The player has a limited number of incorrect guesses before the stick figure is fully drawnand the game is lost. The player wins the game if they guess all the letters of the word before thestick figure is fully drawn.The program should have an array of possible words to choose from. A different word should berandomly chosen from the array every time we run the program.import turtle window = turtle.Screen() t = turtle.Turtle()t.hideturtle()t.speed(0)t.goto(0,0)radius = 100colors = ['brown', 'red', 'magenta', 'blue', 'green', 'orange'] for i in range(20): index = i//6 t.pencolor(colors[index]) t.circle(radius) t.left(10) Try to change either the number of circles or the turning angle value. Discuss the impact of this change on the diagram and explain the reason behind that
- public class BackAccount{public double Balance { set; get; }public void Deposit(double amount){Balance = Balance + amount;} }Transaction FeesTransaction TypeDeposit Withdrawal Check BalanceAmount0.25 % of the deposit amount 0.5 % of the withdrawal amount FreeUsing the code snippet above, complete the bank account functionality by adding Withdraw and CheckBalance methods. In your definition for the Withdraw method, check if the account has sufficient funds before making a withdrawal. Apply transaction fees as per the table above:In a C# Console App do the following Write a method that takes three integers and returns true if their sum is divisible by 3, false otherwise. Write a method that takes two strings and displays the string that has fewer characters. Write a method that takes two bool variables and returns true if they have the same value, false otherwise. Write a method that takes an int and a double and returns their product.I cannot get the return total part to work, this is in python by the way. WEIGHT_LIMIT = 100COUNT_LIMIT = 4wizard_inventory=[] def display_title(): print("The Wizard Inventory program") print() def display_menu(): print("COMMAND MENU") print("show - Show all items") print("grab - Grab an item") print("edit - Edit an item") print("drop - Drop an item") print("exit - Exit program") print() def show(inventory): print("Show inventory")for i in inventory: print(i[0],i[1],"(",i[2],")lbs") total = calculate_weight(inventory)print("Total Weights is : ",total,"lbs")print(" Weight limits of 100 lbs") def calculate_weight(inventory): total =0for i in inventory: print(i[2]) total = total + i[2]return total def grab_item(inventory): list = [] total = 0if(len(inventory)<4): list.extend(get_new_item()) total = calculate_weight(inventory) total = total + list[2] print(total)if(total < 100): inventory.append(list)else:…
- How do I fix this code in order for it to run? BusFareHandler.java package BusFare; public interface BusFareHandler { /** * Initializes your available change. * * * create a MaxHeap with a 1,5,10,25,50,100 coin randomly inserted */ public void grabChange(); /** * get the largest ( in this case the 100 cent ) coin from your maxHeap * * @return max */ public int getMaxFromHeap(); /** * (1) The param for this method should be the result returned from getMaxFromHeap() * * (2) RECURSIVSELY build up the bus fare. * * * (3) Constraint: Bus only accepts 5,25,50,100 cent coins, but you should have other coins in your collection. * * * @param coin */ public int payBusFare(int coin); //week1 test recursive call by selecting next element out of a sorted array instead of calling getMaxFromHeap() } BusFareHandlerImpl.java package BusFare; import MaxHeap.MaxHeap; import MaxHeap.MaxHeapImpl; import java.util.Random; public class BusFareHandlerImpl implements…The first version of Abby’s Eggs worked but was a bit cumbersome. I.e. you couldn’t edit a single parameter, you had to always re-enter all of them. Store the parameters (number of chickens, eggs laid per day, etc.,) in static fields of the class. Have separate methods for updating the parameters. Use a switch statement to take menu selections for updating parameters or outputting results. If the menu choice is 0, the program should terminate, invalid inputs should be ignored and any prompt repeated. Before displaying updated menu, “clear the screen” I got most of the code working, but I can't find a way to clear the sceen before displaying the updated menu. I tried using "System.out.print("\033[H\033[2J"); System.out.flush();", but it is not working. I am using the Apache NetBeans IDE.Implement the Board class. Make sure to read through those comments so that you know what is required. package p1; // You need a random number generator in order to make random moves. Use rand below private static final Random rand = new Random(); private byte[][] board; /** * Construct a puzzle board by beginning with a solved board and then * making a number of random moves. Note that making random moves * could result in the board being solved. * * @param moves the number of moves to make when generating the board. */ public Board(int moves) { // TODO } /** * Construct a puzzle board using a 2D array of bytes to indicate the contents * of the cells in the triangle. * * @param b a "triangular array" with 5 rows where row 0 has 1 * cell, row 1 has 2 cells, etc. */ public Board(byte[][] b) { board = Arrays.copyOf(b, b.length); } public void printBoard() { for (int i = 0; i < board.length; i++) { for (int j = 0; j < board[i].length; j++) {…