ruru_rave(pavlovás, is_holiday) should return True if (pavlovas is between 30 and 70 inclusively) or (is_holiday is True); return False otherwise
Q: what is the valid declaration to store student's age?
A: Here in this question we have asked what is the valid declaration to store student age
Q: Explain the difference between the this keyword and the super keyword. When should each be used?
A: The this keyword is used to access or call current class members(variables or methods or…
Q: Bias values are subject to iterative adjustment O True O False
A: To state true or false for the statement " Bias values are subject to iterative adjustment".
Q: Your Name - Week 1 PA Classes Initial information for each employee Name: John Jones Monthly Salary:…
A: As per the requirement program is developed in java. Algorithm: Step 1: Write the Employee class…
Q: Write the getTotalCase () function. The getTotalCase () function shall return the total number of…
A: Here I have defined the function named getTotalCase(). In this function, I have used a for loop to…
Q: This is what it should look like with correct input. Invoice Total Calculator Customer Type: Regular…
A: ans is given below
Q: For a valid flower name, ask the user for quantity and compute the total Ask the user if he or she…
A: import java.util.*; public class Main{ public static void main (String[] args) { String[]…
Q: Assume that you have a product code that has the following format: XXXXNNN Where X is a character…
A: Below is the detailed PL/SQL program to separate the code into its two parts as shown in the above…
Q: what is idNum variable ?
A: idNum variable
Q: Question 3: Given: int numl, num2, newNum; double x, y; Which of the following assignments are…
A: a. num1=35; ->option a is a valid assignment operator. b. newNum=num1-num2; ->option b is a…
Q: Assume that you have a product code that has the following format: XXXXNNN Where X is a character…
A: Answer :
Q: Which variables below are syntactically incorrect? MAX _mid…
A: The given variables can be declared as follows –int MAX;int _mid;int double;int var@;int peta;int…
Q: Find all the errors in the C++ code below:
A: Step 1:- Program:- #include<iostream>using namespace std;class Point{private:int…
Q: Write code to get information of 5 students (Exam id , average) then check the average them if it is…
A: As no programming language is mentioned, it is solved using basic C++
Q: With the given statement, With the given statement, #include Finclude struct item struct product…
A: The program declares a struct named product containing two variables named id and name. Variable p…
Q: Q2) Read from the user his height and weight and print his BMI (Body Mass Index) using the following…
A: Program Approach: Get the inputs from the user using Console.WriteLine() Read inputs using…
Q: Question 2 The following code segment will print “Congratulation! Correct answer". [Keratan aturcara…
A: Given:
Q: A student will not be allowed to sit in exam if his/her attendance is less than 75%. | Take…
A: Following is the python code for the same : a = int(input("Enter total number of classes held : "))…
Q: Indicate what relational expressions are false. (Choose all that apply) O "Mary" "54"
A: Comparision of the strings : The comparison of two strings is calculated based on the ASCII letter…
Q: The following variable names give an indication of the data each stores. For eachvariable, specify…
A: The variable name is degressKelvin. The data type for the variable could be fixed point or…
Q: Apply a Normal Form on the following table by drawing new table(s). Then answer question: which…
A: The given table can be change into new table by using 1st normal form -because all the cells in…
Q: Write the following string with your information: string="Moead Rehan 19-arid-814"
A: Huffman Coding Coding from Huffman is the lossless algorithm for data compression. The goal is to…
Q: What is the result of : result = !(5 2) && (3<5); << result << endl; ==
A: The logical expression && results in true only if all the conditions evaluates to True
Q: What’s the difference between the TO_CHAR and TO_DATE functions when working with date values?
A: Explanation: Oracle functions are constructed into Oracle Database and can be used in multiple SQL…
Q: The following variable names give an indication of the data each stores. For eachvariable, specify…
A: variable name: quantityPurchased The data type could be decimal. The format string that is most…
Q: See the table STUDENT below: student_id name email gpa 1001 Sarah Adam s@email.com 3.1 1002 Nick…
A: ANSWER : Option : d The statement SELECT COUNT(gpa) FROM STUDENT returns no. of non - null rows in…
Q: single output result (duplicates are allowed) Join the outpUE of the following two unrelated queries…
A: SQL stands for Structured Query Language. SQL commands are used to communicate with a database to…
Q: Use command SORT to sort the data by case status (depressed or not depressed) sort case * Use the…
A: Solution is below !!
Q: Where stud_type_id=student_type.id AND student_type.name='local'
A: The complete answer is given below.
Q: T-SQL procedure for MICROSOFT SQL SERVER A: obtain the name and credit limit of the customer…
A: Given : T-SQL procedure for MICROSOFT SQL SERVER A: obtain the name and credit limit of the customer…
Q: You usually use to reference data values that programs retrieve from the DB. scalar variables…
A: Incorrect options: A. Scalar variables: Scalar variable represents an atomic variable that is not…
Q: feature column in the datasets X_tr and x_te
A: import pandas as pd X_tr = pd.DataFrame(['a', 'b', 'c', 'd', 'e', 'f', 'g'], columns…
Q: Here is my code from part 1. The below directions are an extension of it: #include using…
A: given: #include <iostream>using namespace std;#include "ItemToPurchase.h" int main(){string…
Q: -The second variable should show the percentage of 'trans_fat in 67 total fat.* 68 -*** (r} 69…
A: Note: Answer As per problem mention in problem first of all you are calculating percentage , so…
Q: This kind of code gives me errors i have more info below. My code DELIMITER // CREATE PROCEDURE…
A: Answer: SQL Table Create and Insert Code: CREATE TABLE CUSTOMER(CUST_ID INT NOT NULL PRIMARY…
Q: What value is printed by the following code snippet? name = "John R. Johnson" 11 firstName = "John"…
A: The variable name stores the string value as "John R. Johnson". The variable firstName stores the…
Q: What will the following code display?total = 0for count in range(1, 6):total = total +…
A: Given: Output of Program
Q: Indicate what relational expressions are True. (Select all that apply) "250">"50" "silly">"SILLY…
A: Solution "250" > "50" = False "silly" > "SILLY" = True "100" > "1001"…
Q: # can be expanded from 0 to 9 Generate the Complete Telephone number. Insert all the Complete…
A: Here is the answer below:-
Q: D START Read itemName Read pricePerUnit Read Quantity totalCost = Quantity* pricePerUnit Read…
A: #include <stdio.h> int main(){ char itemname[100]; scanf("%[^\n]s", itemname); float…
Q: Privileged customers are those that made at least 10 orders to the company. A customer can order…
A: I have answered below:
Q: Allow user to enter the price of 3 meals, calculate total price and print the most expensive total…
A: Input Process Output 3 meals price for 15 customers Initialize maxPrice to 0 For i from 1 to 15:…
Q: Which of the following option is correct? Public static int sum(int[] theArray, int cell) { Iff(???)…
A: Here we choose the correct option by using the given information and explain , so the explanation of…
Q: strng ownerliane; string breed; num ownerId; num age; num weight; num weeklyFee; cout « "Please…
A: Correct the given program as follows: Use int data type for the variables that will store numeric…
Q: user to enter his/her job details (e.g. employee name, job title, salary, company name) and prints…
A: The structure definition will be struct Employee { string empName, jobTitle, CompanyName; int…
Q: What is the size of the output resultset after running the statement below? Select lessons.id,…
A: Here in this question we have given two table and we have to run sql on it .and as a result we have…
Q: ity that on any given day there are exactly 10 accounts open is d number of new accounts over one…
A:
Q: 4- Sell a book. Ask the user to enter the ISBN of the book he wants to buy, search for books by SBN.…
A: SUMMARY: - Hence, we discussed all the output.
Q: how do i write the following code using dict.setdefault. (assuming key is a tuple) if key not in…
A: Dictionary in Python is used to store data values like a map in the form of key:value pair.…
Step by step
Solved in 5 steps with 3 images
- Use java Language Write the function parrotTrouble.** We have a loud talking parrot. The "hour" parameter* is the current hour time in the range 0..23. We are* in trouble if the parrot is talking and the hour* is before 7 or after 20. Return true if we are* in trouble.** Some Examples:* parrotTrouble(true, 6) returns true* parrotTrouble(true, 7) returns false* parrotTrouble(false, 6) returns false** @param isTalking true if the parrot is talking.* @param hour the time of day from 0..23.* @return true if you're in trouble with your neighbors.Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: - getScore– This function ask the user for a test score, store it in a reference parameter variable, and validate it. For input validation, do not accept test scores lower than 0 or higher than 100. This function should be called by main () once for each of the five scores to be entered. - calcAverage – This function calculates and display the average of the four highest score. This function should be called just once by main (), by should be passed the five scores. - findLowest – This function finds and returns the lowest of the five scores passed to it. It should be called by calcAverage function, which uses the function to determine which of the five scores to drop.Write a DECIMATOR function that takes a unit of character and minimizes it (i.e. removes the last 1/10 of characters). Always zoom in: if a bullet unit has 21 characters, 1/10 of the characters will be 2.1 characters, so DECIMATOR removes 3 characters. DECIMATOR is not kind! Examples decimator ("1234567890") 12 "123456789" # 10 characters, taken out 1. decimator ("1234567890AB") # 12 characters, 2 are released. "1234567890" decimator ("123") "12" # 3 characters, taken out 1. decimator ("123456789012345678901") # 21 characters, issued 3. Solve in Ruby "123456789012345678"
- Write a function count_evens() that has four integer parameters, and returns the count of parameters where the value is an even number (i.e. evenly divisible by 2). Ex: If the four parameters are: 1 22 11 40 then the returned count will be: 2 Hint: Use the modulo operator % to determine if each number is even or odd. Your program must define the function:count_evens(num1, num2, num3, num4) python # Define your function here if __name__ == '__main__': num1 = int(input()) num2 = int(input()) num3 = int(input()) num4 = int(input()) result = count_evens(num1, num2, num3, num4) print('Total evens:', result)thello is a board game and you are expected to implement the move function for this game. Arguments passed to the function are - a symbol of the player making the move and x y coordinates of the cell at which the player wishes to make the move. The move function will be returning a boolean, false - if the move isn't feasible and true - if the move is feasible and this function will also make the move then i.e. make the required changes in the board. Input Format: Line 1: Integer n (Total number of moves) Line 2: Player 1 coordinates, x and y (Two integers separated by space) Line 3: Player 2 coordinates, x and y (Two integers separated by space) Note 1: Number of moves (i.e. n) is always even and Player 1 always starts the game. Note 2: If any player's coordinates are not valid, enter again till the right move. Main function is given for you reference. Sample Input: 2 24 15 25 Sample Output: 00000000 00000000 00001000 00011000 00021000 00000000 00000000 00000000 false 00000000 00000000…Write a program that generates random numbers between -25 and 25 by using the randint function. The program will add up the numbers and terminate when the sum of the values becomes zero. The program should contain the following functions: add() : add up the values main(): the function where the program execution should begin and end. randomgen(): a function that returns a number between -25 and 25 A global variable subsetsum that keeps track of the sum The program should output the count of the number of values generated before exiting saying that the subset sum was zero.
- Write a value returning function called HasPair. This function accepts three double parameters and checks whether ANY two of the three parameters are equal. If any two parameters are equal, the function returns true; otherwise the function returns false. 2. Write a valueinteger numberthe number isreturns false.A prime numberany reminder, i.e. divisible by itself and 1 only. returning function called isPrime. This function accepts as parameter and checks whether it is prime or not. If prime the function returns true. Otherwise, function is the number that can be divided by itself and 1 withoutPb#1: For several values of x, confirm that eix = cos x + i sin x Pb#2: An object thrown vertically with a speed vo reaches a height h at time t, where h= vo*t - gt2 Write and test a function that computes the time t required to reach a specified height h, for a given value of vo. The function's inputs should be h, vo, and g. Test your function for the case where h=100 m, vo=50 m/s. and g=9.81 m/s2. Interpret both answers. (MATLAB)Write a small unit test harness to test a function whose API is given below. You may use C or pseudocode in your answer. Argument: returns: integer year 1 if the argument year is a leap year. if not a leap year (a common year) * The algorithm it uses is as follows: *if (year not divisible by 4) then (common year) * else if (year not divisible by 100) then (leap year) * else if (year not divisible by 400) then (common year) *else (leap year) */ int leapYear (int year);
- Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: • void getScore() should ask the user for a test score, store it in a reference parameter variable, and validate that it is not lower than 0 or higher than 100. This function should be called by main once for each of the five scores to be entered. • void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores.• int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which one of the five scores to drop.Rolling a single six-sided die produces a random number between 1 and 6 with a uniform distribution. Rolling two dice produces a number between 2 and 12 with a binomial distribution. In this lab you will simulate a number of dice rolls and graph the number of occurrences of each value. 1) Create a function called rollDie() that takes no parameters, and returns a random value between 1 and 6. Do not seed the random number generator in this function. int rollDie() 2) Create a function called initArray() that takes a data array and the size of the array as parameters and fills each element with the summed results of rolling two dice. Do not assume that the data array has been initialized. void initArray(int data[], int size) 3) Create a function called sortArray() that takes an array and the size of the array as parameters, and sorts the array using the sediment sort. void sortArray(int data[], int size) The sediment sort works as follows: start with the second element in the array if…Write the function that takes three dimensions of a brick: height(a), width(b) and depth(c) and returns true if this brick can fit into a hole with the width (w) and height(h). Examples doesBrickFit(1, 1, 1, 1, 1) → true doesBrickFit(1, 2, 1, 1, 1) → true doesBrickFit(1, 2, 2, 1, 1) false Notes • You can turn the brick with any side towards the hole. • We assume that the brick fits if its sizes equal the ones of the hole (i.e. brick size should be less than or equal to the size of the hole, not strictly less). • You can't put a brick in at a non-orthogonal angle.