PYTHON PROGRAMMING
The manager of the Super Supermarket would like to be able to compare the unit price for products sold there. To do this, the program should input the name and price of an item per pound and its weights in pounds and ounces. Then it should determine and display the unit price (the price per ounce) of that item and the total cost of the amount purchased. You will need the following variables:
ItemName PoundPrice Pounds
TotalPrice Ounces UnitPrice

You will need the following formulas:

UnitPrice = PoundPrice/16
TotalPrice = PoundPrice * (Pounds + Ounces/16)

Answers

Answer 1

Answer:

ItemName=input("Enter the name of the item purchased: ")

PoundPrice=input("Enter the price of an item per pound: ")

Pound=input("Enter the weight in pound: ")

Ounce=input("Enter the weight in ounce: ")

UnitPrice=int(PoundPrice)/16

TotalPrice=int(PoundPrice)*(int(Pound)+int(Ounce)/16)

print("The unit price is: "+UnitPrice)

print("The total price is: "+TotalPrice)

If this is what you needed:/


Related Questions

Which of the following are incident priorities?

Answers

Answer:

what are the options?

reply in comment so i can help:)

Which effect is used in this image?
A.
sepia effect
B.
selective focus
C.
zoom effect
D.
soft focus

Answers

Answer:

Please show me the image, it is not there

Explanation:

I will wait, don't worry I will help you whenever you want! :)

there’s no picture
post the question again

Nested loops: Print rectangle Given the number of rows and the number of columns, write nested loops to print a rectangle. Sample output with inputs: 23 * * * 1 num_rows = int(input) 2 num_cols = int(input) 1 test passed VOUAWNP " Your solution goes here" print('*', end='') print All tests passed Run CHALLENGE ACTIVITY 5.8.2: Nested loops: Print seats. Given num_rows and num_cols, print a list of all seats in a theater. Rows are numbered, columns lettered, as in 1A or 3E. Print a space after each seat. Sample output with inputs: 23 1A 1B 1C 2A 2B 2C 1 num_rows = int(input) 2 num_cols = int(input) 1 test passed # Note 1: You will need to declare more variables 5 # Note 2: Place end=' ' at the end of your print statement to separate seats by spaces 7" Your solution goes here" All tests passed 9 print Run

Answers

Answer:

See attachment

Explanation:

The solution and the explanation could not be submitted directly. So,I added both as attachments

To print a rectangle based on the given number of rows and columns, you will use nested loops using the following code:

num_rows = int(input())

num_cols = int(input())

for i in range(num_rows):

   for j in range(num_cols):

       print('*', end=' ')

   print()

How can I print a rectangle using nested loops?

By using nested loops, you will iterate through each row and column to print the desired shape. The outer loop controls the rows while the inner loop controls the columns. Within the inner loop, the desired symbol or character, such as "*", is printed with the print() statement.

The end=' ' parameter is used to separate each character by a space. The outer loop then moves to the next row and the process continues until the desired number of rows and columns are printed forming a rectangle.

Read more about nested loops

brainly.com/question/31921749

#SPJ6

Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. Ex: If the input is: - 15 10 the output is: -15 -10 -5 0 5 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first. For coding simplicity, output a space after every integer, including the last. 5.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleh уен 275344.1613222

Answers

Answer:

Following are the code to the given question:

For code 1:

start = int(input())#defining a start variable that takes input from the user end

end = int(input())#defining a end variable that takes input from the user end

if start > end:#use if that checks start value greater than end value

   print("Second integer can't be less than the first.")#print message

else:#defining else block

   while start <= end:#defining a while loop that checks start value less than equal to end value

       print(start, end=' ')#print input value

       start += 5#incrementing the start value by 5

   print()#use print for space

For code 2:

while True:#defining a while loop that runs when its true

   data = input()#defining a data variable that inputs values

   if data == 'Done' or data == 'done' or data == 'd':#defining if block that checks data value

       break#use break keyword

   rev = ''#defining a string variable rev

   for ch in data:#defining a for loop that adds value in string variable  

       rev = ch + rev#adding value in rev variable

   print(rev)#print rev value

Explanation:

In the first code two-variable "first and end" is declared that takes input from the user end. After inputting the value if a block is used that checks start value greater than end value and use the print method that prints message.

In the else block a while loop is declared that checks start value less than equal to end value and inside the loop it prints input value and increments the start value by 5.

In the second code, a while loop runs when it's true and defines a data variable that inputs values. In the if block is used that checks data value and use break keyword.

In the next step, "rev" as a string variable is declared that uses the for loop that adds value in its variable and prints its values.

Internal monitoring is accomplished by inventorying network devices and channels, IT infrastructure and applications, and information security infrastructure elements. Group of answer choices True False

Answers

Answer:

True

Explanation:

It is TRUE that Internal monitoring is accomplished by inventorying network devices and channels, IT infrastructure and applications, and information security infrastructure elements.

The above statement is true because Internal Monitoring is a term used in defining the process of creating and disseminating the current situation of the organization’s networks, information systems, and information security defenses.

The process of Internal Monitoring involved recording and informing the company's personnel from top to bottom on the issue relating to the company's security, specifically on issues about system parts that deal with the external network.

(100 points) why does file explorer look like this and how do I fix it? I'm not good with computers, and I kinda need help

Answers

Go To View -> Navigation Pane -> Then Click Navigation Pane

Which of the following examples can be solved with unsupervised learning?

Group of answer choices

A list of tweets to be classified based on their sentiment, the data has tweets associated with a positive or negative sentiment.

A spam recognition system that marks incoming emails as spam, the data has emails marked as spam and not spam.

Segmentation of students in ‘Technical Aspects of Big Data’ course based on activities they complete. The training data has no labels.

Answers

Answer:

Explanation:

Segmentation of students in ‘Technical Aspects of Big Data’ course based on activities they complete. The training data has no labels.

1.Siguraduhing _______ang mga datos o impormasyong

2.Isaalang- alang ang partikular na _______ o lokasyon ng pinagmulan ng impormasyon

3.Upang matiyak na hindi ______ang mga impormasyon, maaaring magsaliksik at kilalaning mabuti ang awtor at ang kanyang mga artikulo​

Answers

Answer:

1.maayos

2. Lugar

3. mali

Explanation:

im correct if I'm rwong :-)

What is a geam in the ggplot2 system?
a) a plotting object like point, line, or other shape
b) a method for making conditioning plots
c) a method for mapping data to attributes like color and size
d) a statistical transformation

Answers

Answer:

a) a plotting object like point, line, or other shape

Explanation:

A geom in the ggplot2 system is "a plotting object like point, line, or other shape."

A Geom is used in formulating different layouts, shapes, or forms of a ggplot2 such as bar charts, scatterplots, and line diagrams.

For example some different types of Geom can be represented as geom_bar(), geom_point(), geom_line() etc.

Write a program that will: 1. Call a function to input temperatures for consecutive days in an array. The temperatures are to be integer numbers. 2. The user will input the number of temperatures. There will be no more than 10 temperatures. 3. Call a function to sort the array by ascending order. You can use any sorting algorithm you wish as long as you can explain it. 4. Call a function that will return the average of the temperatures. The average should be displayed to two decimal places.

Answers

Answer:

Following are the program to the given question:

#include<iostream>//defining header file  

using namespace std;

float temperatures()//defining a method temperatures

{

int a[10],i,j,n,min,max,sum=0,temp;//defining integer variable

float avg;//defining floating point variable

cout<<"Please input the number of temperatures to be read: ";//print message

cin>>n;//input integer value

if(i>10)//use if to check array length greater than 10

return -1;//return integer value -1

for(j=0;j<n;j++)//defining loop to input value

{

cout<<"Input temperature: "<<endl;//print message

cin>>a[j];//holding value in loop

}

for(i=0;i<n-1;i++)//defining loop to compare array value

{

for(j=i+1;j<n-1;j++)//defining loop to compare array value

{

if(a[i]>a[j])//use if to compare array values

{

   //swapping

temp=a[j];//holding array value in temp

a[j]=a[i];//holding value in first index of array  

a[i]=temp;//holding temp value

}

}

}

max=min=a[0];//holding max value  

for (i = 0; i < n; i++)//defining loop to compare array value

{

if (a[i] > max)//use if to compare max array value

{

max = a[i];//holding max array value

}

else if (a[i] < min)//use else if to compare min array value

{

min = a[i];//holding min array value

}

}

for(i=0;i<n;i++)//use loop to add array value

sum=sum+a[i];//adding array value

avg=(float) sum/n;//calculating avg of the array

std::cout.setf(std::ios::fixed);//using namespace

std::cout.precision(2);//using precision method

cout<<"The average temperature is: "<<avg<<endl;//print avg value with message

cout<<"The highest temperature is: "<<max<<endl;//print max value with message

cout<<"The lowest temperature is: "<<min<<endl;//print min value with message

return avg;//return avg value

}

int main()//defining main method

{

float k;//defining float variable

k=temperatures();//calling method  

}

Output:

Please find the attached file.

Explanation:

In this code, a method "temperatures" is declared that defines the integer and float variable in which "n, array" is used to store the array value and inside the method min and max variable is declared that use the conditional statement to store its value.

Outside the main method, a floating-point variable "k" is declared that calls the method and stores its value.  

Writing of a program to take two integer and print sum and product of them.
Take two integer input from user and first calculate the sum of the two and then product of the two.
Take two double input for length and breadth of a rectangle and print area type casted to integer.
Take side of a square from user and print area and perimeter of it.

Answers

Answer:

1.)

def two(a, b) :

print(a+b)

print(a*b)

2.)

a = int(input('enter an integer values '))

b = int(input('Enter another integer value' ))

print(a+b)

print(a*b)

3.)

Take side of a square from user and print area and perimeter of it.

def square(a):

area = a**2

perimeter = 4*a

print(area, perimeter)

Explanation:

Code written in python :

The first function named two, takes to arguments a and b ;

The sum of integers a and b is taken and displayed using ; print(a+b)

The product of integers a and b is taken and displayed using ; print(a*b)

2.)

User can enter an input and converted to an integer value using the command ;

int(input()) ; the sum and product of these values are displayed using :

print(a*b) and print(a+b)

The Area and perimeter of a square requires the side length, which is taken as the argument a in the square function defined.

Area of square = a² = a**2

Perimeter = 4 * a

Write a C++ program that displays the appropriate shipping charge based on the region code entered by the user. To be valid, the region code must contain exactly three characters: a letter (either A or B) followed by two numbers. The shipping charge for region A is $25. The shipping charge for region B is $30. Display an appropriate message if the region code is invalid. Use a sentinel value to end the program. Save and then run the program. Test the program using the following region codes: A11, B34, C7, D2A, A3N, C45, and 74TV.

Answers

Answer:

Following are the code to the given question:

#include <iostream>//header file

#include <string>//header file

using namespace std;

int main()//main method

{

string region;//defining a string variABLE

while(true)//defining a while loop for input value

{

cout << "Enter the region code(-1 to quit): ";//print message

cin >> region;//input string value

if(region == "-1")//defining  if to checks string value

{

break;//use break keyword

}

else//else block

{

if(region.length() != 3)//defining if to check string value length not equal to 3  {

cout<<"Invalid region code. Region code must contain exactly three characters."<<endl;//print message

}

else

{

if(region.at(0) == 'A' || region.at(0) == 'B')//defining at method that checks string value

{

if((region.at(1) >= '0' && region.at(1) <='9') && (region.at(2) >= '0' && region.at(2) <='9'))//defining at method that checks string value

{

if(region.at(0) == 'A')//defining at method that checks string value

{

cout<<"The shipping charge for region is $25."<<endl;//print message

}

else

{

cout<<"The shipping charge for region is $30."<<endl;//print message

}

}

else

{

cout<<"Invalid region code. Region code should start with A or B followed by two numbers."<<endl;//print message    

}

}

else

{

cout<<"Invalid region code. Region code should start with A or B."<<endl;//print message

}

}

}

}

return 0;

}

Output:

Please find the attached file.

Explanation:

In this code, inside the main method a string variable "region" is declared that use while loop to the input value and use the conditional statement that checks the input value and print the value as per the condition and print the value.

A capacitor of capacitance 102/π µF is connected across a 220 V, 50 Hz A.C. mains. Calculate the capacitive reactance, RMS value of current and write down the equations of voltage and current.

Answers

Answer:

The capacitive reactance will be "100Ω" and RMS value of current is "2.2 A". A further explanation is provided below.

Explanation:

Given:

[tex]C =\frac{10^2}{\pi}\times 10^{-6} \ F[/tex]

[tex]V_{RMS}=220 \ V[/tex]

[tex]f = 50 \ Hz[/tex]

Now,

The capacitive reactance will be:

⇒ [tex]X_c=\frac{1}{\omega C} =\frac{1}{2 \pi f C}[/tex]

                   [tex]=\frac{1}{2\times \pi\times 50\times \frac{10^{-4}}{\pi} }[/tex]

                   [tex]=100 \ \Omega[/tex]

RMS value of current will be:

⇒ [tex]I_{RMS}=\frac{V_{RMS}}{X_c}[/tex]

             [tex]=\frac{220}{100}[/tex]

             [tex]=2.2 \ A[/tex]

So that,

⇒ [tex]V_m=220\times \sqrt{2}[/tex]

         [tex]=311 \ V[/tex]

⇒ [tex]I_m=2.2\times \sqrt{2}[/tex]

         [tex]=3.1 \ A[/tex]

hence,

The equation will be:

⇒ [tex]\nu=311 sin31 \ 4t[/tex]

and,

⇒ [tex]i=3.1 sin(314t+\frac{\pi}{2} )[/tex]

Suppose your training examples are sentences (sequences of words). Which of the following refers to the j^th word in the i^th training example?

We index into the ith row first to get ith the training example (represented by parentheses), then the column to get jth the word (represented by the brackets).

a. x^(j)
b. x^(j)
c. x^(i)

Answers

Answer:

a. x^<i>(j)

Explanation:

The solution has been explained in the question; however, I will provide further explanation.

The sequence to access a word is:

Training example --> Word

In other words, you first access the training example, before you gain access to the word being searched for.

Rewrite the following:

Training example --> Word

as:

ith training example --> jth word

Hence, the representation is:

[tex]x^{(i)<j>[/tex]

Assume that x is a char variable that has been declared and already given a value. Write an expression whose value is true if and only if x is a decimal digit (0-9).

Answers

Answer:

The expression in python is: x.isdigit()

Explanation:

Given

Character variable x

Required

Expression that evaluates if x is decimal or not

The expression in python is: x.isdigit()

If x is digit 0 - 9, x.isdigit() will equal True

Otherwise, it will equal False

some machine/items/gadget having only hardware​

Answers

Yeh it’s becoz they work with hardware that’s why

You are working on a graphical app, which includes multiple different shapes. The given code declares a base Shape class with an abstract area() method and a width attribute. You need to create two Shape subclasses, Square and Circle, which initialize the width attribute using their constructor, and define their area() methods. The area() for the Square class should output the area of the square (the square of the width), while for the Circle, it should output the area of the given circle (PI*width*width). The code in main creates two objects with the given user input and calls the area() methods.

Sample Input:
5
2

Sample Output:
25
12.566370614359172

The area of the square is 5*5=25, while the area of the circle is PI*2*2=12.566370614359172

Answers

A class can have multiple subclasses, where each of the subclasses function independently. The extend keyword will be used to pass attributes from the Shape class to the Square and Circle subclasses

To answer this question, I will make the following assumptions

The Shape class is already definedThe area() method of the Shape class is also definedLines that begin with // are comments, and these lines will be used to explain the code segment

//This creates the Square class

class Square extends Shape {

//The creates a constructor for width variable

Square(int length) {  this.width = length;  }

//This defines the area() method from the Square class

void area() {  

//This calculates and prints the area of the square

System.out.print(Math.pow(width,2));  } }

//This creates the Circle class

class Circle extends Shape {

//The creates a constructor for width variable

Circle(int radius){  this.width = radius;  }

//This defines the area() method from the Square class

void area(){

//This calculates and prints the area of the circle

System.out.println(Math.PI*Math.pow(width,2));

} }

Read more about abstract class at:

https://brainly.com/question/20261938

Question 1 (10 points)
Saved
A variable's
indicates the type of data that the variable will hold.
a) name
b) data type
c) scope
d) value

Answers

D value Hshdhbsisgbep
D is the answer because the value contains the data type

Explain why Thompson's Construction Algorithm is considered to be a proof by induction. Hint: consider what the inductive steps and base cases are. What does Thompson's Construction Algorithm prove

Answers

Answer:

We assume that the NFA for the expression S is theorem by using the expressions given below.

Cases as

NFA for empty-expression is ε NFA for symbol is a  NFA for union expression is a|b NFA for concatenation expression is ab NFA for Kleene star expression is a*

Thompson's Construction Algorithm proves that any expression can be expressions in the NFA's.

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Answers

I am not able to open the pdf kindly send the jpg form.

what is 5 times 5 times 16 times 11 2345

Answers

Answer:

4,400.

Explanation:

In order to determine what is 5 times 5 times 16 times 11 the following calcularion has to be done:

((11 x 16) x 5) x 5 = X

(176 x 5) x 5 = X

880 x 5 = X

4,400 = X

Therefore, 5 times 5 times 16 times 11 is equal to 4,400.

Answer:

use a cucullated

Explanation:

1. Briefly explain some examples of convergence in the wireless market.​

Answers

Answer:

Some examples of convergence in the wireless market include mobile phones, data communication, radio device etc.

Explanation:

Some examples of convergence in the wireless market are as follows –  

a) Using feature of radio device on phone which is nothing but a default application on the mobile device in the wireless market

b) Data communication is a mode to share data in wireless mode through the internet

c) Mobile phones – Mobile phones are best example of devices operating in the wireless market. It is basically used to call to one or many at a time through network service provider without using an internet


Katie and her mom had an argument. Katie was at the mall when her mom called on her cell phone. What type of noise came up in their
communication?

Answers

Answer:

Noise pollution.

Explanation:

Noise pollution is too loud noise that is harmful to health or that significantly reduces the comfort of the environment or significantly impairs work. Noise pollution arises, for example, from traffic and work machines, as well as from noisy events such as open-air concerts. Noise pollution can also arise from industrial plants (such as wind turbines, rock crushers), work machines (such as cargo handling equipment in ports and other sites), individual machines and equipment (such as leaf blowers, clearing and chainsaws, air conditioners), water pumps) and other noise sources. The noise of the work machines also causes inconvenience to the user of the device if the source of the noise is close to the hearing system of the machine operator.

Convert each number into scientific notation.
1. 4,000,000,000
2. 0.000000027
3. 67,760,000
4. 90,500
5. 540,900
6. 0.00904
7. 0.032
8. 512,000,000

Answers

Answer:

4 * 10^9

2.7 * 10^-8

6.776 * 10^7

9.05*10^4

5.409*10^5

9.04 * 10^-3

3.2 * 10^-2

5.12 * 10^8

Explanation:

1. 4,000,000,000

4 * 1,000,000,000 = 4 * (10*10*10*10*10*10*10*10*10) = 4 * 10^9

2. 0.000000027

27 * 10^-9 = 2.7 * 10^-8

0.000000027 = 2.7 * 10^-8

3. 67,760,000 = 6776 * 10000

6776 * 10000 = 6776 * 10^4

6776 * 10^4 = 6.776 * 10^3 * 10^4 = 6.776 * 10^7

4. 90,500

905 * 100 = (9.05 * 100) * 100

(9.05*100) * 100 = 9.05 * 10^2 * 10^2 = 9.05*10^4

5. 540,900

5409 * 100 = (5.409 * 1000) * 100

(5.409*1000)*100 = 5.409*10^3 * 10^2

5.409*10^3 * 10^2 = 5.409*10^5

6.) 0.00904

0.00904 = 904 * 10^-5

904 * 10^-5 = 9.04 * 10^-3

7. 0.032

32 * 10^-3 = 3.2 * 10^-2

8. 512,000,000

512 * 1000000

512 * 10^6 = 5.12 * 10^2 * 10^6 = 5.12 * 10^8

Write a function:
class Solution { public int solution (int) A); }
that, given a zero-indexed array A consisting of N integers representing the initial test scores of a row of students, returns an array of integers representing their final test scores in the same order).
There is a group of students sat next to each other in a row. Each day, students study together and take a test at the end of the day. Test scores for a given student can only change once per day as follows:
• If a student sits immediately between two students with better scores, that student's score will improve by 1 when they take the test.
• If a student sits between two students with worse scores, that student's test score will decrease by 1.
This process will repeat each day as long as at least one student keeps changing their score. Note that the first and last student in the row never change their scores as they never sit between two students.
Return an array representing the final test scores for each student once their scores fully stop changing. Test Ou
Example 1:
Input: (1,6,3,4,3,5]
Returns: (1,4,4,4,4,5]
On the first day, the second student's score will decrease, the third student's score will increase, the fourth student's score will decrease by 1 and the fifth student's score will increase by 1, i.e. (1,5,4,3,4,5). On the second day, the second student's score will decrease again and the fourth student's score will increase, i.e. (1,4,4,4,4,5). There will be no more changes in scores after that.

Answers

Answer:

what are the choices

:"

Explanation:

Use strlen(userStr) to allocate exactly enough memory for newStr to hold the string in userStr (Hint: do NOT just allocate a size of 100 chars).
#include
#include
#include
int main(void) {
char userStr[100] = "";
char* newStr = NULL;
strcpy(userStr, "Hello friend!");
/* Your solution goes here */
strcpy(newStr, userStr);
printf("%s\n", newStr);
return 0;
}

Answers

Answer:

Following are the complete code to the given question:

#include <stdio.h>//header file

#include <string.h>//header file

#include <stdlib.h>//header file

int main()//main method  

{

  char userStr[100] = "";//defining a char array  

  char* newStr = NULL;//defining a char pointer  

  strcpy(userStr, "Hello friend!");//use strcpy method that holds char value  

  newStr = (char *)malloc(strlen(userStr));//defining a char variable that use malloc method

  strcpy(newStr, userStr);//use strcpy method that holds newStr and userStr value

  printf("%s\n", newStr);//print newStr value

  return 0;

}

Output:

Hello friend!

Explanation:

In this code inside the main method a char array "userStr" and a char type pointer variable "newStr" holds a value that is null, and inside this strcpy method is declared that holds value in the parameters.

In this, a malloc method is declared that uses the copy method to hold its value and print the newStr value.

Viết chương trình thực hiện các công việc sau(sử dụng con trỏ):
a. Nhập vào một mảng các số nguyên n (5<=n<=50) phần tử.
b. Ghi ra file văn bản Sochan.txt các số chẵn của mảng vừa nhập.
c. Đọc file Sochan.txt sắp xếp mảng số chẵn theo thứ tự giảm dần và in kết quả ra
màn hình .

Answers

Answer:

ahbtibrkn

Explanation:

uklbejixbi9538021#fbn

Consider the following class definition.
public class Example {
private int x;
// Constructor not shown.
}
Which of the following is a correct header for a method of the Example class that would return the value of the private instance variable x so that it can be used in a class other than Example ?
private int getX()
private void getX()
public int getX()
public void getX()
public void getX(int x)

Answers

Answer:

public int getX()

Explanation:

From the question, we understand that the value is to be accessed in other classes.

This implies that we make use of the public access modifier. Using the public modifier will let the instance variable be accessed from other classes.

Also, we understand the return type must be the variable type of x. x is defined as integer. So, the constructor becomes public x

Lastly, we include the constructor name; i.e. getX().

Hence, the constructor is: public int getX()

JAVA CHALLENGE ZYBOOKs
ACTIVITY
2.18.3: Fixed range of random numbers.
Type two statements that use nextInt() to print 2 random integers between (and including) 100 and 149. End with a newline. Ex:
112 102
My Previous Incorrect Attempt :
import java.util.Scanner;
import java.util.Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen.setSeed(seedVal);
/* Your solution goes here */
int first = randGen.nextInt(10);
int second = randGen.nextInt(10);
System.out.println(first*seedVal*14);
System.out.println(second*seedVal*(51/4)+6);
}
}
MUST BE USED CODE TEMPLATE:
import java.util.Scanner;
import java.util.Random;
public class RandomGenerateNumbers {
public static void main (String [] args) {
Random randGen = new Random();
int seedVal;
seedVal = 4;
randGen.setSeed(seedVal);
/* Your solution goes here */
}
}

Answers

Answer:

Replace  /* Your solution goes here */ with:

System.out.println(randGen.nextInt(49) + 100);

System.out.println(randGen.nextInt(49) + 100);

Explanation:

Required

Statements to print two random numbers between 100 and 149 (both inclusive)

First, the random numbers must be generated. From the template given, the random object, randGen, has been created.

The syntax to then follow to generate between the interval is:

randGen.nextInt(high-low) + low;

Where:

high = 149 and low = 100

So, the statement becomes:

randGen.nextInt(149 - 100) + 100;

randGen.nextInt(49) + 100;

Lastly, print the statements:

System.out.println(randGen.nextInt(49) + 100);

System.out.println(randGen.nextInt(49) + 100);

Write a program that does the following: - Ask user to input lengths of three sides. - Classify it into one of the following: o Equilateral triangle o Isosceles right triangle o Isosceles triangle that is not a right triangle o A triangle that is not an isosceles and not an equilateral For example, an execution could look like

Answers

Answer:

You did not specify which programming language you use, but you can use if statements to check each using the sides.

- A triangle is equilateral when all the 3 sides are equal. (a = b = c)

- A triangle is isoscles when two of the sides are equal (a = b or b = c or c = a)

- A triangle is right when square of side C is equal to the sum of the squares of the other two sides. (c^2 = a^2 + b^2)

- For the last classification you can use "else"

If you noticed, the condition to have an isosceles triangle is repeated for two of the tasks so we can use the same if statement to check if the triangle is isosceles right or just isoscles with two built-in if statements (if and else)- if it's right then it's isosceles right else it's just isosceles.

And else statement for the last task.

Example code structure:

If triangle is Equilateral then

- Equilateral Triangle

end

If triangle is Isoscles then

if triangle is right then

- Isoscles Right Triangle

end

else (the triangle is not right)

- Isoscles Triangle

end

end

else (the triangle is not Equilateral nor Isoscles)

- Triangle that is not isoscles nor equilateral.

end

Explanation:

Here is a code example with java, I hope it helps, although it might not be the programming language you use:

import java.util.Scanner;

public class Triangle {

public static void main(String[] args) {

Scanner input = new

Scanner(System.in);

System.out.print("side a = ");

int a = input.nextInt();

System.out.print("side b = ");

int b = input.nextInt();

System.out.print("side c = ");

int c = input.nextInt();

if (a == b &amp;&amp; b == c)

{

System.out.println("Equilateral Triangle);

}

else if (a == b || b == c || a == c) {

if ( (int) math.pow(c, 2) == (int) (math.pow(a, 2) + math.pow(b, 2)))

{

System.out.println("Isoscles Right Triangle");

}

else {

System.out.println("Isoscles triangle that is not a right triangle");

}

}

else {

System.out.println("Triangle that is not Isoscles nor Equilateral");

}

}

}

Let me know if you have any questions.

Other Questions
The yearbook staff ordered 8 boxes in the first order. They end up with a total of 168 yearbooks after both orders. Importance of market form of meat (fresh, chilled and meat cuts for dish)please helppppp asap:(( The distance to the grocery store is13.456 miles. Round this distance tothe nearest whole number, In a class of students, the following data table summarizes how many students play an instrument or a sport. What is the probability that a student plays a sport given that they play an instrument? which sum or difference is modeled by the algebraic tiles? 3. Two dice are rolled. Whats the conditional probability that both dice are 5s if its known that the sum of points is divisible by 5? please help me find the area These blood vessels carry waste products, such as carbon dioxide to the heartA)ArteryB)VeinC)CapillaryD)Plasma g you hang an object of mass m on a spring with spring constant k and find that it has a period of T. If you change the spring to one that has a spring constant of 2 k, the new period is 44 : 20 is equivalent to __ : 520 : 15 is equivalent to 4 : __5 : 2 is equivalent to __ : 8 solve for this square. can anyone help meewith summary of this text i will give brainliest uhelp plz asap Solve the system of equations given below. (Please--help..) Who is the last European dictator? may I please have help from anyone thank you so much ! Increasing the surfactant concentration above the critical micellar concentrationwill result in: Select one:1.An increase in surface tension2. A decrease in surface tension3. No change in surface tension 4.None of the above Which is an equation of a circle with center (2,7) and radius 4?(x - 2)2 + (y - 7)2 = 4Part(x - 7)2 + (y - 2)2 = 165. Part(x + 2)2 + (y + 7)2 = 4d(x - 2)2 + (y - 7)2 = 16 When writing an effective argument, it is important to ? A)address the counterclaims right away to weaken their effectB)ignore refuting evidence against your claimC) develop complex reasons to avoid addressing the claimD)change your claim statement in the middle to reinforce a counterclaim Gizmo Inc. purchased a one-year insurance policy on October 1 for $5,280. The adjusting entry on December 31 would be: (If an amount box does not require an entry, leave it blank.) What is the total area of the garden?