What is the value of the following expressions (or ERROR)? 1. __________ s.length() 2. __________ t.length() 3. __________ 1 + a 4. __________ a.toUpperCase() 5. __________ "Tomorrow".indexOf("r") 6. __________ "Tomorrow".lastIndexOf('o') 7. __________ "Tomorrow".substring(2,4) 8. __________ (a.length() + a).startsWith("a") 9. __________ s = = a 10. __________ a.substring(1,3).equals("bc")
Q: Jake is not sure why his code below is printing 11 instead of 9? What is going wrong and why? a…
A: Variables that are defined inside a function body have a local scope, and those defined outside have…
Q: Write a C++ program to achieve the following requirements using an online platform, a screenshot is…
A: Here is the C++ code. CODE : OUTPUT :
Q: Which of the following is a FALSE statement? O Low level languages need more memory space than High…
A: A computer only understands the machine language that is 0 and 1. Machine code is machine-specific,…
Q: python: what was wrong with this? ----------------------------------------------- A = { "action":…
A: In python, indentation is important during loop statement. If you are using for loop , then you have…
Q: -For external input, which of the following instructions is used? Aşayuakiieiuemangisi bir ueyişkeT…
A: Instructions: Instruction is defined as "the act of educating, offering the steps to be followed or…
Q: Can you see where I did wrong in this program ? They show in compiler : ar@osboxes:~…
A: The modify code after removing error is given below: #include<iostream>#include…
Q: //rotate tank in action transform.Rotate(0, turnForce, 0); transform.position += transform.forward…
A: To convert unity script to C# code. UNITY : Unity Scripting tells our GameObjects how to behave;…
Q: The script in the bash shell of Linux Write a calculator script using if and elif statements…
A: #!/bin/bash #bash calculator if [ "$1" = "add" ]; then res=$(($2 + $3)) echo$2 + $3 = $res elif […
Q: 9. In the right triangle shown a = 17 cm and c = 50 cm. Define a and c as variables, and then: a)…
A: $ awk '{print "side:",$1,"side:",$2,"hypotenuse:",sqrt($1^2+$2^2)}'$1 and $2 are the input fields,…
Q: the code below in detail. What is going to be done? What is the order of Lines L1,L2,L3,L4 ouput on…
A: It is defined as an interface for executing an operation. It extends the Command interface,…
Q: What is floating-point literal? Select one: O a. All of these O b. It could be double or float…
A: Here, we are given 3 MCQs and i have provided answers for all 3 questions. Questions are related to…
Q: which variables are visible and what are their values at point assuming dynamic scoping. whats…
A: Answer:
Q: What does the counter1 provide at the end of this script? x=[ 30 e e 2 1 -1 -2 -3]; counter1=0;…
A: 1) The above script does below activites It Creates a vector x consisting of positive, negative and…
Q: 1. Answer the following questions with true of false a. T/F you can adjust the range for a…
A: Question 1: a.) The point light has a very relatively simple effect as we only need to adjust the…
Q: Hi, I need help in changing this phyton code to Dr. Racket. Please. def encode(str1): str2 =…
A: The solution have different Strings in the encode() method for getting the target string. The…
Q: -For external input, which of the following instructions is used? Aşayuakieiuemangisi bir ueyişkeT…
A: Set locale: The set locale() function is used to change or query the current locale of the…
Q: What is the value of the following expressions (or ERROR)? 1. __________ s.length() 2. __________…
A: Note: There are multiple questions given in one question. According to the rule, you will get the…
Q: Q11/ A: What are the main keywords are includes in iostream.h and math.h ? B: What are the main…
A: Header Files: eg (#include<iostream.h>) '#' :This is known as the pre-processor operative,…
Q: Which of the following will not provide a valid output? Group of answer choices float(2.3e2)…
A:
Q: What will argc be in the following invocation? . /a.out hello 'out there in' "'" tv land a) 6 b) 5…
A: Solution: Given,
Q: Q4 What is the compiled MIPS assembly code for the following C code? GI Inobuse int x = 0; int y =…
A: This is related to MIPS assembly language. code is commented and screenshot is also attached.
Q: 14. What will be the output of the following PHP code? a) Error b) My name is PhpPhp c) My…
A: Question 14. What will be the output of the following PHP code? <?php $foo = 'Php';…
Q: In my python Maya script, I am trying to make a snowball followed by more snowballs varying in…
A: using System;using System.Collections.Generic; public class Master{ public CyclicNetwork…
Q: Suppose we have this program: int main() { printf("d"); fork(); printf("f"); } We…
A: Here fork() statement will create a new child process. The process will be a replica of parent…
Q: Which of the following are ways that you can make your code easy to read and to navigate? (Check all…
A: Answer: I have given answered in the brief explanation
Q: Consider the following declarations, which appear in the main() function of a program. uint32_t x =…
A: Here in the given program the variable x has value 100. And *y is a pointer that points towards the…
Q: QUESTION 14 Which lines of the following code contain syntax error? which line can create runtime…
A: Dear Student, 1) Syntax errors is at line numbers 8, new blank string declaration syntax is - String…
Q: Create a simple calculator which can perform basic arithmetic operations like addition, subtraction,…
A: Simple calculator to perform arithmetic operations like addition, subtraction, multiplication, or…
Q: 04/ For the function below: f(x) = √5 cos(2.5x) e-0.5x - √3 sin(3.5x) In (0.5x) | For 2n ≤ x ≤ 6 1-…
A: Given :
Q: What is the language of the following TM? b→R a-R a→R (la b→R u¬R u-R Ir O b*(ab)* aa O (aU b)* aa O…
A: Ans:- (a+b)^* aa this language accepted by turing machine
Q: Hello. Please look at the following code. When I run it from the command line, I am supposed to get…
A: Try to run the code mentioned in the second step. it should solve your issue.
Q: Given the following data declarations and code (within main), what is printed to the console window?…
A: The Answer is in Below steps
Q: CLASS OF 2019 Welcome MySAIL Oakland Un X Th Course: CSI-1420-43702.201940 X…
A: Create a main method in the C program and read input from the user. And subtract the second time,…
Q: According to the program below is there anything wrong ? 1 mov al,00 2 mov bl,12h…
A: Assembly Language Instructions are the machine instructions , which uses the mnemonics to specify…
Q: Which of the following is false about Python? O Python is a high-level language O Python is a…
A: Python invented by Guido van Rossum is a high-level, interpreted, and general-purpose programming…
Q: Execute the given program in MARS and answer the following short questions. .text main: li $a0,5 jal…
A: As per bartleby guidelines, for more than one question, 1st one is to be answered. Please upload…
Q: In the right triangle shown a = 17 cm and c = 50 cm. Define a and cas variables, and then: 9. a a)…
A:
Q: What are the parameters of the main function when using command line arguments? int argc, int*…
A: Command line arguments are the arguments given by user at the start of execution
Q: 13. The following very complex subroutine moves the cursor down to the next line. What, if anything,…
A: According to the information given :- we have .ORIG x4000NEWLINE LD R0, CRLF…
Q: Improve this JavaScript code that will require input from the user. Below are the code that needs to…
A: Please find the answer below :
Q: Q1. A script that can be used as a calculator with four major operations, i.e. “+-/*”. The script…
A: Algorithm: 1. Peruse Two Numbers2. Input Choice (1-Addition, 2-Subtraction, 3-Multiplication,…
Q: Java - Which of the following represents an infix expression followed by the postfix equivalent?…
A: We need to find the correct Infix expression followed by the postfix equivalent. We have multiple…
Q: 6) Write a script that will prompt the user for a temperature in degrees Celsius, and then an F for…
A: * As per the company norms and guidelines we are providing first question answer only please repost…
Q: 6) Write a script that will prompt the user for a temperature in degrees Celsius, and then an F for…
A: 1) Since you have not specified script language, I have written in python script language 2) Below…
Q: Step 3. Test your program. Below is an example of what the program output should look like. Your…
A: Steps: Import the module for the Random Create an object for a Random Declare an array of size 10.…
Q: Please answer properly with output screenshot must Where is the error in this code?
A: Given Code: from telethon.sync import TelegramClientfrom telethon.tl.functions.messages import…
What is the value of the following expressions (or ERROR)?
1. __________ s.length()
2. __________ t.length()
3. __________ 1 + a
4. __________ a.toUpperCase()
5. __________ "Tomorrow".indexOf("r")
6. __________ "Tomorrow".lastIndexOf('o')
7. __________ "Tomorrow".substring(2,4)
8. __________ (a.length() + a).startsWith("a")
9. __________ s = = a
10. __________ a.substring(1,3).equals("bc")
Step by step
Solved in 2 steps with 9 images
- A program developed for a web store represents customer account balances using a format that approximates real numbers. While testing the program,, a software developer discovers that some values appear to be mathematically imprecise. Which of the following is the most likley cause of the impression.- The account balance are represented using a fixed number of bits, resulting in over flows- The account balance are represented using a fixed number of bits, resulting in round off erros- The account balances are representedusing an unlimited number of bits, resulting in overflow errors.- The account balances are representedusing an unlimited number of bits resulting in round off errorsWhich of the following are ways that you can make your code easy to read and to navigate? (Check all that apply) ?mean mean? Searching for the function name on the r-project.org website. Searching for the function name on the rdocumentation.org website.What does this regex do?re.compile(r'[ckCK]ath([e]*r[yi]n[e]*|[yi])')What are 6 stings that would match the Regular Expression? Using the regular expression from question 1, write a python script that will take in a string as an argument, and print whetherthe string matches the Regular Expression. So for example, if your script is named "myscript.py", you should be able to run:-python myscript.py Kathyand the script would print a message indicating a match. However, if you run:python myscript.py Bob the script would print a message indicating that there was not a match.
- Can you help me put comments in every line of the code below. It's a c++ language. I used this in arduino. int baselineTemp = 0;int celsius = 0;int fahrenheit = 0; void setup(){ pinMode(A0, INPUT); Serial.begin(9600); pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(7, OUTPUT);} void loop(){ baselineTemp = 40; celsius = map(((analogRead(A0) - 20) * 3.04), 0, 1023, -40, 125); fahrenheit = ((celsius * 9) / 5 + 32); Serial.print(celsius); Serial.print(" C, "); Serial.print(fahrenheit); Serial.println(" F"); if (celsius < baselineTemp) { digitalWrite(2, LOW); digitalWrite(3, LOW); digitalWrite(4, LOW); } if (celsius >= baselineTemp && celsius < baselineTemp + 10) { digitalWrite(2, HIGH); digitalWrite(3, LOW); digitalWrite(4, LOW); } if (celsius >= baselineTemp + 10 && celsius < baselineTemp + 20) { digitalWrite(2, HIGH); digitalWrite(3, HIGH); digitalWrite(4, LOW); } if (celsius >=…Consider the following declarations, which appear in the main() function of a program.uint32_t x = 100;uint32_t* y = &x Which property of x may change during its lifetime?A. the value of x B. the type of x C. the size of x in bytes D. the memory address of xMark Daniels is a carpenter who creates personalized house signs. He wants an application to compute the price of any sign a customer orders, based on the following factors: The minimum charge for all signs is R30. The first six letters or numbers are included in the minimum charge; there is a R7 charge for each additional character. White characters are included in the minimum charge. A sign with “black” characters; an additional R10 is included and an additional R12 charge for “gold” characters.APM11A1 - Advanced ProgrammingThe program must prompt the user for the characters or digits and the color of the characters. The house sign may consist of two or more words. Display the final price of the design as shown in Figure 1. The program must iterate until the user enter END. the question shoulb be answered in c++
- What is wrong with the following program? #include <iostream> //Line 1using namespace mySpace //Line 2{ //Line 3const double PRIZE = 50000.00; //Line 4int x; //Line 5} //Line 6 using namespace std; //Line 7int main() //Line 8{ //Line 9double num; //Line 10num = 2 * PRIZE; //Line 11mySpace::x = static_cast<num>; //Line 12cout << PRIZE << " "…Can you add class level comments, function level comments and inline comments In this line int i,n=0,s=0; they say the assigned value is not used can you fix that package avgsum;import java.util.Scanner; /**** @author Zaahid*/public class AvgSum { /*** @param args the command line arguments*/public static void main(String[] args) { int i,n=0,s=0;double average;{System.out.println("Enter the 5 numbers : "); }for (i=0;i<5;i++){Scanner in = new Scanner(System.in);n = in.nextInt();s +=n;}average=s/5;System.out.println("The sum of 5 numbers is : " +s+"\nThe Average is : " +average);}Consider the following source code : c = a + b d = c c = c – e a = d – e b = b * e b = d/b Which of the following is correct optimization of given code? 1. c = a + b t = b * e a = d – e b = d/t c = a 2. c = a + b d = c c = c – e a = d – e b = d/b 3. d = c c = c – e a = d – e b = b * e b = d/b 4. None of the above
- Which XXX completes the power function? public class ExponentMethod {public static double raiseToPower(double base, double exponent){if (exponent != 0) {XXXelse {return (1/base) * raiseToPower(base, exponent+1);}}else {return 1;}}public static void main(String args[]){ int userBase;int userExponent;userBase = 2;userExponent = 4;System.out.println(userBase + " ^ " + userExponent + " = "+ raiseToPower(userBase, userExponent));}}Write a program in python that can fetch the top 1000 news articles from Google news everyday and then search each individual news article title up in bing.com every 11 minutes. Remember when the program activates the local computer browser to search the news article up every 11 minutes. After each search the program should terminate the local computer browser and then reopen it and this can prevent 1,00 browser tabs from being open and taking on a lot of ram. Please write full code.In python >>> build_csv_string([["Sam", "Lab 01", 5.4]]) 'name,assignment,grade\nSam,Lab 01,5.4' >>> build_csv_string([["Sam", "Lab 01", 5.4], ["Zoe"]]) 'name,assignment,grade\nSam,Lab 01,5.4\nZoe,N/A,0' >>> build_csv_string([["Sam", "Lab 01", 5.4], ["Zoe"], ["Amanda", "Quiz 04", 100]]) 'name,assignment,grade\nSam,Lab 01,5.4\nZoe,N/A,0\nAmanda,Quiz 04,100'