Y = Math.sqrt(4) * Math.abs(4) The value of Y is ______ a. 8 b. -16 c. 16 d. -8
Q: Suppose you are a surveyor. Your job requires you to study some maps that give distances in…
A: To Do: a program to convert distance. by using - pass by value -pass by reference
Q: A palindromic prime is a prime number and also palindromic. For example, 131 is a prime and also a…
A: Since programming language not mentioned, using C++
Q: C++ Code Mr. Naughty loves to play with balls. So, his friend, Mr. Nice, gave him n balls to play…
A: Code process The first line contains the same number n - the number of balls. Inext n lines contain…
Q: 2) A BMI Calculator: the body mass index (BMI) is a measure used to determine whether a person is…
A: Java Code import java.util.Scanner; public class Test { public static void main(String[] args) {…
Q: One of the most popular games of chance is considered to be a game of dice, known as "Craps", which…
A: import java.util.Random;public class DiceGame {Â Â public static void main(String[] args) {Â Â Â Â…
Q: 23. A perfect number is a positive integer that is equal to the sum of its positive divisorsexcept…
A: The below given java program will obey the following rubrics:Importing essential header…
Q: My library > CMPSC 8: Introduction to Computer Science h. > = zyBooks 2.11: LAB: Computing driving…
A: PROGRAM CODE: # take the value of miles per gallonmil = float(input())# take the value of dollars…
Q: Assignment Write a program that moves a forester unit and a desert corps unit to a given target…
A: Assignment Write a program that moves a forester unit and a desert corps unit to a given target…
Q: C++ This is what i have as a solution. Can you check If this makes sense according to the question…
A: // Destructor Train::~Train() { // current node Car *curr = tHead; // iterate through…
Q: Time -hour:int -minute:int -second:int hour minute second [0, 23] [0, 59] [0, 59]…
A: public class TimeMain { public static void main(String[] args) { Time t1=new…
Q: Edit question Write a Java program in java eclipse ide Generate 35 “even” random integer numbers in…
A: As per the requirement program is completed. Algorithm: Step 1: Write the main() method Step 2:…
Q: Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia")…
A: As no programming language is mentioned it was solved using basic C++
Q: What is the value of num3 after the following code is executed: int num1; int num2; int num3; num1 =…
A: value of num1 is 15.
Q: Write an application in Java which defines String=”hello world”, convert it into character array…
A: code: import java.util.*; public class GFG { public static void main(String args[]) {…
Q: Write a program that prompts for an integer (that a side length) and displays, using asterisks, a…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: 1. Write a program that prints your name, age, and department in console 2. Write a program that…
A: As no programming language is mentioned, it is solved using C++
Q: 1.Using pseudocode, a method that will add two numbers, and return the sum to the calling function.…
A: The, code has given below:
Q: 3). In a math class you lean about the different operations that can be done to a series. Imagine…
A: //include the required header file #include <iostream> using namespace std; //definition of…
Q: A complex number is a number in the form a + bi, where a and b are real numbers and i is sqrt( -1).…
A: Program is written in java language as following- import java.util.Scanner;public class…
Q: Python Language Useful websites: : http://en.wikipedia.org/wiki/Radix…
A: Task :- Write a Python function to find the kth digit for given number. Python program :- def…
Q: #include stars in the form of void main(){ int i,j; for (i=0;i0;j-{ if(j>5+i| lj<5-i) cout<<" ";…
A: For i =0 and j =10 the if condition becomes true that is 10 >5 hence the print statement will…
Q: A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her…
A: Program Approach Make a method to return the total calories from number. Input the Fat Grams.…
Q: 2 ii) int a = 5; //L1 //L2 5; i <= 6; i++) for (int i { а %3D а + 3; System.out.println(a); } a = a…
A: In this question, we are given a java language code. And we have to trace it and find out the…
Q: 2. - Write a program that displays the area and perimeter of a rectangle with the width of 5 And…
A: width=5; #initialize widthheight=7.5; #initialize height area=width*height; #calculate area…
Q: 1- Write a java Program to read a number from user and print full pyramid using numbers which will…
A: Refer to step 2 for the java program.
Q: Write a Java program that asks the user for three integer values and displays them sorted in…
A: Lets see the code in the next step
Q: 4.Write a program that displays a Pascal triangle. The program prompts the user to enter the number…
A: The answer is in below steps:
Q: a Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is…
A: The given parts are related to Java packages (in-built) calendar and TimeZone which are used to get…
Q: 1. Write a program that prints your full name. Write a program that prints your full name using…
A: 1.) #include <iostream> using namespace std; int main(){string name;cout<<"Write your…
Q: he twins Kartik and Kunaal want to play word search puzzles with their class. They want to be faster…
A: • check all cells. If a cell has the first letter, we will then try all 8 directions one by one from…
Q: In Python: A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth…
A: In this code, we are checking that the year entered by user is leap year or not, if the year is leap…
Q: for (i=5; iusing namespace std; int main () {int a[7];int i ;for (i=O ; i> a[i] ;} * true O False…
A: Three bits are solved in c++. please check the details below.
Q: void func1(int&); void func2(int&, int&); void func3(int, int); eint main(){ int x = 0, y = 0, z =…
A: Introduction of the Program: The C++ program is an example of pass by reference where the reference…
Q: int fun(int x, int y) { if (y == 0) %3%3D return 0; return (x + fun(x, y-1)); int fun2(int a, int b)…
A: To do: Explain the given Program
Q: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the…
A: Programming language is not defined so I am providing program in python. Pseudo code Declare a…
Q: Change the program above to add the numbers 157 and 13. (Hint: these numbers are constants and…
A: Mail box Mnemonic code Numeric code Instruction 00 IN 901 ;input 1st number 01 STO 99 399…
Q: Examine the code snippet below, and indicate what are the Arguments? int result = Sum(5,6,7); ..…
A: The values that are passed during a function call are called arguments.
Q: def SomeMethod(a,b): a= a+b b=b+a print(a,b,end=" ") return (a+b) def main(): x=10…
A: The answer is..
Q: Calculate and return the sum of two decimal numbers - getSum.
A: NOTE:“Since you have asked multiple questions, we will solve the first question for you. If you want…
Q: int age = getAge(); /*get age as input from the user*/ void display (int age); /*prints the…
A: Hi there, Please find your solution below, I hope you would find my solution useful and helpful.…
Q: JAVA CODE PLS Rectangle by CodeChum Admin A rectangle can be formed given two points, the top left…
A: Answer :
Q: 2 iii) int a = 5; //L1 //L2 for(int i = 5; i <= 6; i++) { а %3D а + 3; System.out.println(a); //L3…
A: Given: \
Q: C++ Program point* nearer(point* p1, point* p2) This method will return whichever point, either p1…
A: Calculate distances from this point to p1 and p2 Store the distance values in 2 variables Compare…
Q: Question #1: Treadmill burned calories Java Program A treadmill workout machine provides the…
A: import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner…
Q: void func (__ ---){ *total = *x* *y; a. int *x, int *y, int *total O b. int &x, int &y, int &total O…
A: A function is basically a block of code that is used to do some computation. It has a return type.…
Q: (Java) The greatest common divisor of two positive whole numbers and n1 and n2 is the largest number…
A:
Q: HangmanAA.java For this program, you will create the game Hangman. (If you are unsure of how to…
A: Programming instructions: Create a class. In the main, create a scanner object to take input from…
Q: What does the following code display? int [] arr2 = {1, 2, 3}; for (int i = 0; i < arr2.length;…
A: Answer
Q: What is the value of i after this code executes? int i 10; while(i < 15){ i--; %3D
A: C++ is a very famous programming language these days, It is an Object oriented programming, which is…
Q: 1 int computeArithmeticProgression(int num) 0; 2 int sum = 3 for (int i = 1; i <= num; i++) {
A: Given:
The value of Y is ______
Step by step
Solved in 3 steps
- What will the following code display?names = ['Jim', 'Jill', 'John', 'Jasmine']if 'Jasmine' not in names:print('Cannot find Jasmine.')else:print("Jasmine's family:")print(names)Declare three structs: Struct TravelInfo{ String name; Double weight; Double newWeight; Int planetChoice; Int speed; }; Struct TravelTimeCalc{ Int totalTravelTime; Int years; Int days; Int hours; }; Struct Planet{ String planetNames; Double distanceFromSun; Double gravity; }; Planets, distance from sun(millions of miles), surface gravity as a percent of earth’s gravity: Mercury 36 0.27 Venus 67 0.86 Earth 93 1.00 Mars 141 0.37 Jupiter 483 2.64 Saturn 886 1.17 Uranus 1782 0.92 Neptune 2793 1.44 Pass the arrays to the FillPlanetInfo function that will load the data into the three arrays. Start a do while loop in main Pass the function AskSpaceTravellerInfo a reference to the TravelerInfo struct variable and the array of planet names. Get the user’s name, Earth weight, the speed they want to travel and the planet they wish to visit. Provide a menu with the planet names and a way for the user to select the chosen destination. Pass the data you obtained…Rock, Paper, Scissors Game Create a application using (C#) in Microsoft Visual Studio that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you use clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules: •If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)•If one player chooses scissors and the other player chooses paper, then scissors wins.…
- user_tickets = int(input())if user_tickets< 5:num_tickets=1else:num_tickets= user_ticketsprint('Value of num_tickets:', num_tickets)Nice Number Programming: Nice program ask user to enter three integers from keyboard (java console), the three integers represent left bound, right bound and arbitrary digit 'm', where left bound is less than right bound. Program should print all nice numbers in the given range that doesn't contain digit 'm'. The number is nice if its every digit is larger than the sum of digits which are on the right side of that digit. For example 741 is a nice number since 4> 1, and 7> 4+1. with digit m=2. Write a complete program in Java that Call only One method (niceNumbers method) that will print all nice numbers excluding a given digit 'm' that also entered by user?Problem Description: The international standard letter/number mapping found on the telephone keypad is shown below: Write a pseudocode and program that reads a letter and displays its corresponding digit. 2 3 1 ABC DEF 4 5 6 GHI JKL MNO 7 8 9 PQRS TUV WXYZ 0 Write a pseudocode on how you would solve the problem in your own word. Write a java program called Phone considering the following directions. Practice here first then write answer on the answer sheet. Also, make sure distinguish high and low caps as Java is case – sensitive. Import and declare a Scanner class Ask user for an Upper – case letter Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the program Print the corresponding digit
- cout<<"Team name is is "< cout<<"The team got "<<no for (int i=0;i<no_of_medal cout<<medals[i]<< cout<<endl; Sport_team::~Sport_team() { delete []medals; cout<<"Memory free"<<endl } void f(Sport_team o) { cout<<"Team info print by o.print(); } void main() { Sport_team s; string n; int m; cout<<"Enter the sport's cin >>n ; cout<<"Enter number of me cin>>m; . set(n, m) ; s.print(); f(s) ; s.print();Need help coding in Java Morgan’s Department Store distributes bonuses to its salespeople after the holiday rush. Table 9-6 shows the bonuses, which are based on full weeks worked during the season and the number of positive online customer reviews. Write a program that allows a user to continuously enter values for the number of weeks worked and the number of positive reviews received and displays the appropriate bonus until the user enter a sentinel value: 99.FLEX & YACC hw Please add commentaries inside the code Make calculator also run with float numbers.
- Zybook Lab highway_number = int(input())if(highway_number>=1 and highway_number<=99): if(highway_number%2==0): print("I-"+str(highway_number),"is primary, going east/west.") else: print("I-"+str(highway_number),"is primary, going north/south.") elif(highway_number>=100 and highway_number<=999): highway_number_string = str(highway_number) length = len(highway_number_string) rightmost_digits = int(highway_number_string[length-2:length]) if(rightmost_digits==0): print(highway_number,"is not a valid interstate highway number.") elif(rightmost_digits%2==0): print("I-"+str(highway_number),"is auxiliary, serving I-",rightmost_digits,"going east/west.") else: print("I-"+str(highway_number),"is auxiliary, serving I-",rightmost_digits,"going north/south.")else: print(highway_number,"is not a valid interstate highway number.") i am getting whitespace error on output : I-290 is auxiliary, serving I- 90 going…(PYTHON) A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams x 3.9 Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs = carb grams x 4 The nutritionist asks you to write a program on *PYTHON* that will make these calculations.Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 9. Given the following code, the output is the date and time of __.Calendar cal = Calendar.getInstance(); TimeZone tz = TimeZone.getTimeZone("Europe/Rome");TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome" time zone.B. the time zone is computer is currently set to use.C. the "America/Los_Angeles" time zone.D. the "Asia/Istanbul" time zone.E. All of the three listed time zones. Part 2 - 10. Given the following code, the output is the date and time of __. Calendar cal = Calendar.getInstance();TimeZone tz = TimeZone.getTimeZone("Europe/Rome");cal.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));TimeZone tz = TimeZone.getTimeZone("Asia/Istanbul");System.out.println(cal.getTime()); A. the "Europe/Rome"…