4- Given the following table for letter grades and their corresponding remarks, write a JavaScript function that implements it. (Hint: You can use the switch expression) Message to be sent You are excellent You are good You are Ok Letter Grade A В C D Fair F Poor
Q: 7) ( )If we define variables: int a=2, b-4, c-6; the value of the following expression ((a> b? a: b)…
A: The required code has ternary operators (denoted by '?' which is short form of if-else) and thus are…
Q: Write a Java program to print 'Hello' on screen and then print your name on a separate line.…
A: As per our company guideline, we are supposed to answer only one question per question and kindly…
Q: Give an example in which passing an argument by reference would be useful.
A: Suppose we want to change the content of array elements. That is multiply each element by 2. Now a…
Q: Given what is supposed to be typed and what is actually typed, write a function that returns the…
A: function findBrokenKeys(str1, str2) { var brokenLetters = []; for (var i=0; i<str1.length; i++) {…
Q: we have a function called send email and send email is going to send an email. It's not going to…
A: #include<iostream> using namespace std; //function declaration with 3 parametersvoid…
Q: This is a question of Ocaml: *) (* An employee is a tuple of name, age, and boolean indicating…
A: A function is created as tuple_print. The functions accepts a tuple of the format string * int *…
Q: Write a python program that creates two global variables, one to store the number of incorrect…
A: here we write simple sudo code for this : if loop till 5 .
Q: Q2: Write a JavaScript function that accepts a number from a user as input and checks if the number…
A: I give the code in javascript along with output and code screenshots
Q: A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22, ....…
A: GIVEN: A pentagonal number is defined as for and so on. So, the first few numbers are 1, 5, 12, 22,…
Q: Input a character from user and print following about the input character. By using functions.…
A: Functions in programming: The functions in the programming are defined as the instructions which are…
Q: We can assign a value to each character in a word based on their position in the alphabet (a = 1, b…
A: We can assign a value to each character in a word based on their position in the alphabet (a = 1, b…
Q: Create a function that transforms sentences ending with multiple question marks? or exclamation…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: Computer Science In python, how do I make a function that will initiate a round of a game, in a…
A: The code is given below.
Q: Write a python3 script: 3. Write a void function, with one argument, which prints that argument.…
A: Solution: Python Code: # This function with one argument # print the argument def fun(name):…
Q: vi) Write a function in Javascript that takes an integer n as the parameter and returns the number n…
A: I have answered this question in step 2.
Q: Return Something to Me! Write a function that returns the string "something" joined with a space " "…
A: C++ is an object based programming language used to create high level applications.
Q: Write the function that returns the number of days he needs to buy the cost of his first car. Jayesh…
A: In this problem, we need to design a program in java programming and show into the above desired…
Q: in the real world, it is easy to be fooled by the description of a problem into thinking that you…
A: Python sued to answer this question
Q: I am trying to understand what it means when a variable or a function is static, but still not sure…
A: static keyword is used to protect the value of variable from changing and to prevent in change of…
Q: T-Shirt: Write a function called make_shirt( that accepts a size and the text of a message that…
A: (1) Program code: def make_shirt(size, message): ''' print the summary of the shirt that is…
Q: Exercise 2: Write a function that takes the following prototype: void f1(double x, int N, double&…
A: The answer is pretty easy:-
Q: Write a Python function called weighted average (), which reads four variables from the keyboard and…
A: """Python program to calculate and display weighted averaga of four inputs""" #function to reads…
Q: Create a function that takes a string with at least one sentence in it and returns a string with the…
A: function reverseLegoYoda(text) { let arr; let tex = ""; let array = text.split(". "); for (let i =…
Q: Write a function that returns a decimal number from an octal number. The function header is as…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: Write a function that prints characters using the following header:def printChars(ch1, ch2,…
A: NOTE: SINCE THE LANGUAGE OF THE PROGRAM IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: javascript 9. Return a Boolean if a number is divisible by 10 Here, you'll create a function…
A: Function to return true if number is divisible by 10, otherwise return false is following: function…
Q: Define a function calc_total_inches, with parameters num_feet and num_inches, that returns the total…
A: logic: total=12*feet+inches display total
Q: C programing Given the function below, what would the function call question3(10, 101) return?…
A: In C programming language, any functions are allowed to call multiple times. If the function call…
Q: Given a word, create a function which returns whether or not it's possible to create a palindrome by…
A: Code const isPalindromePossible = str => { const regex = /(.)(.*?)\1/; return !regex.test(str)…
Q: 3. A certain CS professor gives 100-point exams that are graded on the scale 90-100:A, 80–89:B,…
A: Ans: Code: score = int(input("Enter the exam score:"))if score > 90 and score < 100:…
Q: Write JavaScript programs to solve the following problems. Store your answer in separate html files.…
A: Step 1 : Start Step 2 : In the HTML Page Take user input for the Serial number using a text box.…
Q: Create a function that transforms sentences ending with multiple question marks? or exclamation…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: Write a function that returns the number of days in a year using the following header:def…
A: //********C++ class Calendar program to calculate *******////****************number of years, months…
Q: Return Something to Me! Write a function that returns the string "something" joined with a space…
A: Introduction: In this question we need to return a value to appending at a last of something. for…
Q: In the real world, it is easy to be fooled by the description of a problem into thinking that you…
A: def hide_letter(s): # here s[1:] will return all letter of string s #except first…
Q: Write a function that checks whether an integer is an even digit or an odd digit integer using the…
A: Odd or Even: A certain variety is given conjointly the} task is to count even digits and odd digits…
Q: Write a python program. Write a function called guess() that does the following 1. takes a character…
A: Algorithm : Step 1 : declare global variable word. guess function definition : Parameters :…
Q: Fill in the blank in the function below such that the function takes in two Card objects and returns…
A: You need to write card_one.suit == card_two.suit where card_one and card_two are the class objects…
Q: addThreeValues ( value1, value2, double value3) { /lvalue1 is a whole number, we are first getting…
A: ••The first blank will be double ••Then the second blank will be int value1 because value 1 is a…
Q: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color (default…
A: Given: Write the following function that draws a line from point (x1, y1) to (x2, y2) with color…
Q: Create a function that transforms sentences ending with multiple question marks? or exclamation…
A: In this problem, we need to provide the solution in the PHP programming language. Input - String.…
Q: 1) Run the multiple-target assignment statement below by using C++, Java and Python. Display the…
A: Using C++ :- #include <iostream> using namespace std; int main() { int a,b,c;…
Q: write a function doubleVowel in Python that accepts a word as an argument and returns True if the…
A: def doubleVowel(n): for i in range(len(n)-1): if(((n[i]=='a'or n[i]=='e'or n[i]=='i'or…
Q: Write a function that checks whether two words are anagrams. Two words are anagrams if they contain…
A: #include <iostream>#include <string>using namespace std; bool isAnagram(const string…
Q: All functions A.) return true or false B.) receive a parameter C.) must be named differently…
A: Lets analyze each options: All functions A)return true or false functions can return int, float,…
Q: int snakes[100] = {0}; int ladders[100] = {0}; snakes[31] = 11;…
A: C++ programming language is an object-oriented programming language, that's a cross-platform…
Q: • Write a JavaScript program to: • Read the Fahrenheit temperature • implement function that convert…
A: Please refer below code and output screenshot for your reference: Language used is JavaScript:…
Q: Solution in Java Script Create a function that takes two numbers as arguments and return the LCM of…
A: Algorithm - Take input from user. Now use the below logic - if (max % min === 0) return min;…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images
- 1 - Nuclear Power Plant (python) The nuclear powerplant at Threeyedfish will automatically run a program to print a warning message when the reactor core becomes unstable. The warning message reads: NUCLEAR CORE UNSTABLE!!! Quarantine is in effect. Surrounding hamlets will be evacuated. Anti-radiationsuits and iodine pills are mandatory. Since the message contains crucial information, it should be printed three times. To do this, write a function that prints this message. This function has to be used three times.Write a function which accepts the user’s first and last name and prints the first name 4 timesseparated by tabs, and last name 2 times separated by spaces. (1 tab = 4 spaces)Example OutputEnter the first name: JohnEnter the last name: MorganJohn John John John Morgan MorganThis is a javascript function. Please input the response of this function in the field below. function test(name, birth_year, current_year) { const age = current_year - birth_year; const response = name + " is " + age; return response;}test("alice", 1823, 1902) Enter the return value of the function.
- FOR C++, PLEASE SEND THE CODE IN 30 MINUTES. WRITE THE ANSER OF THIS QUESTION IN THE GIVEN CODE. Write a function that checks whether the furniture is in good quality. Assume that it is in good quality if the average quality of the materials exceeds 0.5. #include <iostream>#include <string>#include <vector> using namespace std; class Material { private: string name; int amount; float quality; public: Material() { } Material(string name, int amount, float quality) { this->name = name; this->amount = amount; this->quality = quality; } string getName() { return this->name; } int getAmount() { return this->amount; } float getQuality() { return this->quality; } void print() { cout << "Name: " << this->name << " Amount: " << this->amount << " Quality: " << this->quality << endl; }}; bool…Answwr asap 9.Write a function hello(firstname, lastname), which, for example, if called with hello('James, 'Barth'), would print two lines: Hello James Barth Hello Barth, James. Use the function in a program where you ask the user for first and last name and then call the function.?Create a function that accepts a string (of a person's first and last name) and returns a string with the first and last name swapped. Examples NameShuffle("Donald Trump") - "Trump Donald" NameShuffle ("Rosie O'Donnell") - "O'Donnell Rosie" NameShuffle ("Seymour Butts") - "Butts Seymour" • There will be exactly one space between the first and last name. In c#
- Javascript I am stuck on a piece of code and I can quite figure out how to finish one part of this function. This is what I have so far: const usersTestArray = [ {id: "1", name: "Joe Graham", option: "option1"}, {id: "2", name: "Kyle Howell", option: "option2"}, {id:"3", name: "Lucy Bauch", option: "option3"}, {id: "4", name: "Sammie Lebsack", option: "option4"} ] const createSelectOptions = (usersTestArray) => { if(!usersTestArray){ return undefined } return userTestArray.map((x) => x.option) } Most of this is correct, however, in the function above, I need to add a create an option element for each user in the array with document.createElement(). I then need to assign the user.id to option.value and the user.name to option.textContent. then it is supposed to return an array of option elements.Write a function hello(name), which prints "Hello" followed by the value of name. For example, hello('James') would print "Hello James". Write a program that asks the user for their name, and then uses the function to greet the person.Q2: Write a JavaScript function that accepts a number from a user as input and checks if the number is prime, then print True if the number is not a prime, print False. Note: A prime number (or a prime) is a natural number greater than 1 that has no positive divisors other than 1 and itself.
- Input a character from user and print following about the input character. By using functions. Islower Isupper Isalpha Isdigit Ispunct IsspaceFOR C++, PLEASE SEND THE CODE IN 20 MINUTES!!! ANSWER THIS QUESTION IN THE GIVEN CODE Write a function that check whether there is enough material in the container for building the given recipe. #include <iostream>#include <string>#include <vector> using namespace std; class Material { private: string name; int amount; float quality; public: Material() { } Material(string name, int amount, float quality) { this->name = name; this->amount = amount; this->quality = quality; } string getName() { return this->name; } int getAmount() { return this->amount; } float getQuality() { return this->quality; } void print() { cout << "Name: " << this->name << " Amount: " << this->amount << " Quality: " << this->quality << endl; }}; bool isInGoodQuality(Material*, int);bool canBeBuilt(Material*, Material*,…1. Write a function that converts a phrase into pig Latin. A word is convertedto pig Latin by removing the first character of the word, placing it at theback of the word, and adding the characters “ay” to the word. For example,“hello world” in pig Latin is “ellohay orldway.” Your function can assumethat each word consists of at least two letters and that each word is separatedby one space, with no punctuation marks.2. Write a function that counts the occurrences of a word in a string. Thefunction should return an integer. Do not assume that just one space separates words and a string can contain punctuation. Write the function sothat it works with either a String argument or a StringBuilder object.3. Write a function that takes a number, such as 52, and returns the numberas a word, as in fifty-two.4. Write a subroutine that takes a simple sentence in noun-verb-object formand parses the sentence into its different parts. For example, the sentence“Mary walked the dog” is parsed into…