What is the output produced from the following statements? (Treat tabs as aligning to every multiple of eight spaces.)

System.out.println("name\tage\theight");
System.out.println("Archie\t17\t5'9\"");
System.out.println("Betty\t17\t5'6\"");
System.out.println("Jughead\t16\t6'");
Expert Answer

Answers

Answer 1

Answer:

// this will be the output of the following statement.

name    age     height

Archie  17      5'9"

Betty   17      5'6"

Jughead 16      6'

Explanation:

First print statement will print name, age and height separated by a tab space. Then next print statement print Archie, 17 and 5'9"  separated by a tab space in new line.Similarly third print statement will print Betty, 17 and 5'6" and in new line the last print statement will print Jughead,16 and 6' separated by a tab space in the next line.


Related Questions

Write a program that inputs the number of hours you are taking this semester and outputs how much time outside of class you should spend studying. (Hint: every 1 credit hour = 2-3 hours spent outside of class).

Answers

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variables

   int a,b,c;

   //ask to enter semester hours

   cout<<"Enter the number of hours in the semester:";

   // read the semester hours

  cin>>a;

  //print the semester hours

  cout<<"You have taken "<<a<<" hours in semester."<<endl;

  // find the time spend outside of the class

  b=a*2;

  c=a*3;

  // print the time outside class

  cout<<"you should spend "<<b<<"-"<<c<<" hours outside of class"<<endl;

return 0;

}

Explanation:

Read the hours taken in the semester from user and assign it to "a".

Then find its 2 and 3 time.This will be the time user should spend outside

of the class.

Output:

Enter the number of hours in the semester:15

You have taken 15 hours in semester.

you should spend 30-45 hours outside of class  

If you were looking for the answer to this

A student is studying for a social studies test, and he is also writing a paper and reading a novel for his language arts class. Which statement represents a well-written SMART goal that the student has written for himself for one study session?

Spend time studying for social studies and language arts by the end of the semester.

Spend time today on social studies, and spend time tomorrow on language arts.

Spend one hour reviewing chapter six for social studies, one hour writing the paper, and four hours reading the novel.

Spend 30 minutes reviewing section one of chapter six for social studies, one hour writing an outline for language arts, and 30 minutes reading the novel by 9 p.m. today.

The answer is D :)

Because when you look up this question this one pops up so im posting this so people can find the answer.

Polymorphism means (Points : 2) many forms
inheritance
driver
many birds

Answers

Answer:

many forms

Explanation:

Polymorphism is a construct in object oriented programming which means multiple forms.For example: Suppose I have a function which performs the add operation on two integers and another function with the same name which concatenates 2 given strings:

int add ( int a, int b);string add ( string a , string b)

The two functions represent polymorphic forms of the add function. The function to be invoked at runtime is determined by the runtime argument type.

For example , add (2,3) will invoke int add ( int a, int b);

Similarly, add("hello","world") will invoke string add ( string a , string b);

Which of these software packages is not open source software (OSS)? (1 point) (Points : 1.5) Microsoft Windows
Mozilla Firefox Web browser
Apache Web server
a Linux operating system

Answers

Answer:

Microsoft Windows

Explanation:

Open Source Software is a software which is accessible to the public. we can modify or extend the code .In the given options Microsoft windows is not an open source operating system. User don't have access to source code where as Linux is an open source software where you can't limit to the functionality which they provided. you can control and extend the source code which they given for this OS

What's the difference between a Boolean function and a Boolean expression?

Answers

Explanation:

A boolean function is a function in any programming language whose return type is boolean means a function that returns true or false.For ex:-

bool func(int a,int b)

{

     if(a>b)

return true;

else

return false;

}

An expression is a combination of one or more variables,constants,operators,function and which is computed and produces a value in case of boolean expression the value that is calculated is either true or false.

for ex:-     bool result= a>b  && a>c;

Write a CPP Program to read an integer number. Use a pointer to display this numbe

Answers

Answer:

#include <iostream>

using namespace std;

int main() {

   int n,*p;

   cin>>n;//taking input.

   *p=n;//passing the address of n to pointer.

   cout<<*p<<endl;//printing the number using the dereferncing operator.

return 0;

}

Explanation:

The above written program in in C++.This program takes input of the integer n and stores the address of the integer in the pointer p. For printing the value of the to which the pointer is pointing we need to used the dereferencing  operator * .

Minimizing ____ is key to maintaining a competitive edge: it leaves competitors insufficient time to introduce their own products first. ISs can contribute significantly to this effort.

lead time

market time

production time

tracking time

Answers

Answer: Lead time

Explanation:

 Minimizing the lead time is one of the key to maintain the competitive edge. Lead time is basically defined as the time period between production of the product to the product are get manufactured in the market. It is also known as time to market.

it basically gives competitive edge when the lead time is reduced over the other products with the high lead time.

The main advantage of the lead time is to make reduce the lead time so that the organization can provide the fastest and reliable delivery of products and services.

An application specifies a requirement of 200 GB to host a database and other files. It also specifies that the storage environment should support 5,000 IOPS during its peak workloads. The disks available for configuration provide 66 GB of usable capacity, and the manufacturer specifies that they can support a maximum of 140 IOPS. The application is response time- sensitive, and disk utilization beyond 60 percent does not meet the response time requirements. Compute and explain the theoretical basis for the minimum number of disks that should be configured to meet the requirements of the application.

Answers

Answer:

60 minimum number of disks that should be configured to meet the requirements of the application.

Explanation:

Requirement of space for database = 200 GB

Usable Capacity for configuration = 66 GB

so the size requirement can be calculated as below :

Size requirement = 200/66 = 4 Disks

IOPS supported during peak processing cycle = 5000 IOPS

Max No. of IOPS supported = 140 IOPS

AS,The application is response time sensitive, and disk utilization beyond 60 percent does not meet the response time requirements, so,

IOPS requirement can be calculated as

IOPS requirement = 5000 IOPS/ (140x0.6 IOPS) = 60 disks

. Why use parallel processing for data mining?

Answers

Answer:

 Parallel processing is the type of the processing in the computer program instruction by divide into the multiple processors unit. The parallel processing basically allow the interleaved execution the given program together.  

The parallel processing basically uses the multiple element for processing the solution of the problems simultaneously. it basically divide the problem  into independent parts so that the processing of the elements can execute simultaneously.

Its main objective of the parallel processing is that compile and run the program in short duration or time.  

.Consider the following sine wave: s(t) = 4sin(2π3t + π)

a.What is the amplitude?

b.What is the frequency?

c.What is the phase?

Answers

Answer:

a. 4

b. 3

c. pi

Explanation:

Generic formula of a sine wave: s(t) = Amp * sin ( 2*pi*freq*t + phase)

where, Amp => Amplitude

freq => frequency

phase => phase

Given sine wave: s(t) = 4sin(2π3t + π)

Comparing it with the generic form , we can identify that :

a. Amplitude : 4

b. Frequency : 3

c. Phase : pi

Amplitude measures peak displacement from origin, Frequency is the number of cycles per second and phase is the relative positioning of the wave with respect to the origin.

Answer:

1) Amplitude = 4

2) Frequency  =[tex]1Hz[/tex]

3) Initial phase = [tex]\pi [/tex]

Explanation:

The general equation of wave is

[tex]y(t)=Asin(\omega t+\phi )[/tex]

where

A is the amplitude of the wave

[tex]\omega [/tex] is the angular frequency of the wave

[tex]\phi [/tex] is the initial phase of the wave

The given wave function is

[tex]s(t)=4sin(2\pi t+\pi )[/tex]

Comparing with the standard function we get

1) Amplitude = 4

2) Frequency  =[tex]\frac{\omega }{2\pi }=\frac{2\pi }{2\pi }=1Hz[/tex]

3) Initial phase = [tex]\pi [/tex]

A systems flowchart:

Select one:

a. must always contain on-page connectors.

b. includes physical as well as electronic flows.

c. requires more than one entity.

d. must always have a data store if there are paper documents involved.

e. must be balanced.

Answers

Answer: (D)  Must always have a data store if there are paper documents involved.

Explanation:

 A system flowchart is basically responsible for displaying the data in the system and also control the flow of data. The system flowchart are basically use various graphic symbol for representing the systematic manner for processing the output.

It basically contain data store in the system if there is data documents present in the system so that it make easy to store the data in the system.

There are basically four symbols that is use to represent in the program flowchart is that are: Firstly start, processing, decision making and then end.

_________ Code that you write is called primary code, and code that the compiler produces after processing the primary code is called runtime code

Answers

Answer:

The correct answer for the given question is  "source code"

Explanation:

When you writing a code in any programming language that code is known as  source code.The source code is also known as primary code, when source code is compiles it produce runtime code.

The source code is created by the compiler it can be easily understood by the human being.

for example in c language we write a source code after compilation it produces object code .

Answer:

The correct answer for the given question is  "source code"

Explanation:

When you writing a code in any programming language that code is known as  source code.The source code is also known as primary code, when source code is compiles it produce runtime code.

The source code is created by the compiler it can be easily understood by the human being.

for example in c language we write a source code after compilation it produces object code .

A cybercrime: Select one: a. Is the act of defaulting on a properly signed agreement entered into upon the internet. b. Can be committed if a computer is the object of a crime, the subject of a crime, or the instrument of a crime. c. Always requires intent to commit a bad act in order to be prosecuted. d. Is synonymous with cyber terrorism

Answers

The answer is B because cyber crime is when a computer is used to commit criminal activities.

Write pseudocode that demonstrate passes an array of six integers (10, 5, 15, 20, 30, and 25) into three functions called multiple_of_ten(), half(), and sum_and_average(). The multiple_of_ten function should accept a copy of each value in the array and determine whether the value is a multiple of 10. The half function should accept the array and output the first three integers in the array. The sum_and_average function should accept the array and compute the sum and average of all of six integers.

Answers

Answer:

multiple_of_ten(x):

eval_x = []

for i in x:

  if (i%10) == 0:

    eval_x.append('it is multiple of 10')

  else:

    eval_x.append('it is not multiple of 10')

 return eval_x

half(x):

 half = len(x)//2

 return x[:half]

sum_and_average(x):

  sum = 0

  for i in x:

    sum = sum + i

  avg = sum/len(x)

  return sum,avg

Explanation:

Function multiple_of_ten():

In this function, first you create an empty array in which you will store your results (evaluation messages in this case). Then you evaluate every element of the array in a for loop, by using the modulo operation.

The Modulus is the remainder of the division of one number by another. % is called the modulo operation.

For instance, 10 divided by 5 equals 2 and it remains 0. Any multiple of 10 will get a 0 remainder.

Therefore, every time you apply the modulo operation to an element in the array, and get a zero, you get a message 'it is multiple of 10', and a message 'it is not multiple of 10' otherwise.

Yo store the message you obtain per each number into the empty array you created at the beginning and you return that array as output of the function.

Function half():

In this function, you calculate the length of the array and apply floor division. Floor division returns the quotient(answer or result of division) in which the digits after the decimal point are removed.

For instance, 6 is the length of the array. you divide 6 by 2 and floor division will give you 3 as a result. This floor division will help you when the length of your array is odd.

Finally you return the array from the beginning till the number in the position given by floor division (in our example, 3), as output of the function.

Function sum_and_average():

In this function, you create a variable that will store your sum result. you initialize this variable as 0. then you use a for loop to sum up every element of your array to the variable you created.

Once you sum up all the elements you use that result and divide it by the length of your array in order to calculate the average.

Finally you return both the sum and the average as outputs of the function.

Who developed one of the first mathematical models of a multilevel security computer system?

A. Diffie and Hellman

B. Clark and Wilson

C. Bell and LaPadula

D. Gasser and Lipner

Answers

Answer:

C. Bell and LaPadula

Explanation:

The first mathematical models of multilevel security computer system was developed by Bell and Lapadula. Their full names are David Elliot Bell and Leonard J. Lapadula. Their model used to define the concept of modes of access,secure state machine and outlined the rules of access.

you need to extract data from the system your predecessor created. you discover tables have been created according to the third normal form. you find the needed data in three different tables. what SQL syntax allows you to garner this data?
a. union
b. join
c. Select
d. Having

Answers

Answer:

b. join

Explanation:

Correct answer:

Join: It allow join(paste) two tables by one or more commun columns

Example in the image attached

Bad answer:

Union: it only allow paste two tables with the same structure

select: it only allow get information from 1 table if not use join

having: it only allow get filtered information with a condition

Write a C++ program that allows the user to enter double values. Display one of two messages: "The first number you entered is larger", "The second number you entered is larger". Save file as LargerorNot.cpp

Answers

Answer:

Following are the program in c++

#include <iostream> // header file

using namespace std; // namespace

int main() // main function

{

double a,b; // variable declaration

cout<<"Enter the first number and second number : \n";

cin>>a>>b; // input the number

if(a>b) // check first number greater than second number

{

cout<<"The first number you entered is larger";

}

else

{

cout<<"The second number you entered is larger";

}

return 0;

}

Output:

Enter the first number and second number :

45.5

687.8

The second number you entered is larger

Explanation:

In this program we have declared two variable i.e a and b of double type. After that check the condition if(a>b) if this condition is true then display  the message "The first number you entered is larger " otherwise display the message  "The second number you entered is larger".

Write a C program that displays your name and address (or if you value your privacy, a frictionless name and address)

Answers

Answer:

Following are the program in c language

#include <stdio.h> // header file

int main() // main method

{

   char name[90]="mantasa"; // storing name

   char add[90]="120 lal bangla mumbai"; // storing address

    printf("\n Name:%s\nAddress:%s",name,add); // print name and address

   return 0;

}

Output:

Name:mantasa

Address:120 lal bangla mumba

Explanation:

In this program we are declaring the two array of char type which will store the name and address . after that we display name and address.

Why are random-access files preferable to sequential-access files in performance- oriented situations?

Answers

Answer: Random-access files are those file types which have the capability of being accessed anytime directly without the requirement of any other support or file.The reading and writing of data can be done from anywhere and any point of time.

Sequential-access files are those files which can be accessed only in sequential manner for the writing and reading purpose.The sequence followed is from beginning to end of file.

Performance-oriented situation requires those files in working that can perform with the superior ability to carry out the job and can be assessed easily as per demand.Thus, these features are performed by random access file as compared with sequential-access files.So, random -access files are more preferred .

The if statement regards an expression with the value 0 as __________.

Answers

Answer:

The answer to this question is "false".

Explanation:

In this question, the answer is wrong because in computer science. Except for the binary language, It didn't understand any language. In computer 1 stands for true value and 0 stands for false value. In If-else statement if block executes true value is that is 1. and else block execute false value that is 0. In this question, if the value is 1 then the answer is true. But the answer to this question is false.

Define an array of the length 6 with the elements of WORD type. Initialize the first and the last of them with the same value of your choice; leave the remaining four uninitialized.

Answers

Answer:

string words[6];

words[0]="humming";

words[1]=words[0];

Explanation:

The above statement declares an array of size 6 which can store elements of type string or word. Then I have initialized the first and second elements with the word humming and the rest of the places in the arrays are uninitialized.

You have to include the header file string so that this array could work otherwise it will not.

Assume you are given a variable x below:

int x = 10;

Create a pointer and save the memory address the variable x to the pointer:

Answer:

4.) You are given a class below, create a accessor and mutator function for field age.

class Student

{

public:

string name;

private:

int age;

}

Answers

Answer:

int x=10;

int *p=&x;

4)

class Student

{

public:

string name;

private:

int age;

public:

int accessor()   //accessor

{

   return age;

}

void mutator(int value)   //mutator function.

{

   age=value;

   return;

}

}

Explanation:

The above written statement creates a pointer of name p.Then the address of variable x is stored in the pointer p and it is done by using the & referencing operator.By doing this the address of the variable x is stored in pointer p.

In the next question two public functions are created with the names accessor and mutator respectively.Accessor function are used to access private values in the class and the Mutators are used to set the prviate values.That is what the accessor and mutator function is doing in the class.

Simplify the following Boolean expressions using algebraic manipulation.

a. F(a,b) = a’b’ + ab + ab'

b. F(r,s,t) = r’ + rt + rs’ + rs’t’

c. F(x,y) = (x + y)’(x’ + y’)’

d. F(a,b,c) = b'+ bc + ab + a'bc'

e. F(a,b,c,d) = ac + b'd + a'bc + b'cd'

Answers

Answer:

Simplification of the expressions:

a) a’b’ + ab + ab' = a +b'

b) r’ + rt + rs’ + rs’t’ = r' + s' + t

c) (x + y)’(x’ + y’)’ = False

d) b'+ bc + ab + a'bc' = True

e) ac + b'd + a'bc + b'cd' = c + b'd

Explanation:

The step by step solution for each expression will use the following laws of Boolean Algebra:

Idempotent Law:

aa=a

a+a=a

Associative Law

:

(ab)c=a(bc)

(a+b)+c=a+(b+c)

Commutative Law

:

ab=ba

a+b=b+a

Distributive Law

:

a(b+c)=ab+ac

a+(bc)=(a+b)(a+c)

Identity Law

:

a*0=0   a*1=a

a+1=1   a+0=a

Complement Law

:

aa'=0

a+a'=1

Involution Law

:

(a')'=a

DeMorgan's Law

:

(ab)'=a'+b'

(a+b)'=a'b'

Absorption  Law:

a+(ab)=a

a(a+b)=a

(ab)+(ab')=a

(a+b)(a+b')=a

a+(a'b)=a+b

a(a'+b)a*b

Step by step Solution:

a) F(a,b)  = a’b’ + ab + ab'

a(b+b')+a'b'  Commutative Law

a+a'b  Complement Law

F(a,b)=a+b' Absorption  Law

b) F(r,s,t) = r’ + rt + rs’ + rs’t’

(r'+rs')+rt+rs't' Absorption  Law

r'+s'+rt+rs't' Distributive Law

r'+s'+rt+s' Absorption  Law

r'+s'+rt Absorption  Law

F(r,s,t) = r'+s'+t Absorption  Law

c) F(x,y) = (x + y)’(x’ + y’)’

(x'y')(x''y'') DeMorgan's Law

(x'y')xy Involution Law

x'(y'x)y  Associative Law

x'(xy')y  Commutative Law

(x'x)(y'y)  Associative Law

(0)(0) Complement Law

F(x,y)=False

d) F(a,b,c) = b'+ bc + ab + a'bc'

b'+c+b(a+a'c')  Absorption  Law

b'+c+b(a+c')  Absorption  Law

b'+c+ba+bc'  Distributive Law

(b'+ba)+(c+bc')  Associative Law

b'+a+c+b  Absorption  Law

1+a+c  Complement Law

F(a,b,c)=True

e) F(a,b,c,d) = ac + b'd + a'bc + b'cd'

ac+a'bc+b'd+b'cd'  Commutative Law

c(a+a'b)+b'(d+cd')   Associative and Distributive Law

c(a+b)+b'(d+c)  Absorption  Law

ac+bc+b'd+b'c  Distributive Law

ac+(bc+b'c)+b'd  Associative and Commutative Law

ac+c(b+b')+b'd  Associative and Distributive Law

ac+c*1+b'd  Complement Law

c(a+1)+b'd  Distributive and Identity Law

F(a,b,c,d)=c+b'd

Answer:

Explanation:

a) De Morgan's law: i) a * b = '(a' + b)

                                 ii) a + b = '('a + 'b)

b) Associativity: (r * s') + (s * t) + ( t' * r)

c) Commutativity: i) x + y = y + x

                             ii) x * y = y * x

d) Distributivity: a * ( b + c) = (a * b) + (a + c)

The more critical a component or service, the higher the level of availability required. True False

Answers

Answer: True

Explanation:

 Yes, the given statement true that the if the component and any type of the services are critical then, there is higher level of the availability require. The critical component and services basically require more steps of implementation and also people so that they can verify each step of component and services that are implemented.

The high availability is basically the ability of the component system that are operated continuously to get the desired product availability. It also increase the efficiency of the desired component and services.

Final answer:

True, critically important services require a higher level of availability. Industries with higher stakes like airlines and healthcare invest more in reliability and security to avoid significant disruptions and maintain operations, reflecting the balance between higher costs and the need for constant system availability.

Explanation:

The statement 'The more critical a component or service, the higher the level of availability required' is indeed true. In the context of business and Information Technology (IT), critical functions demand higher availability because any downtime can result in significant disruptions, financial loss, and damage to reputation.

For instance, industries like airlines and healthcare require a near-constant uptime due to the high stakes involved in their operations. An IT breakdown in these fields could have dire consequences, not just in terms of revenue but also in terms of human safety. Therefore, these sectors invest heavily to ensure reliability and security of their services. Conversely, in organizations where IT is less critical, there may be less willingness to invest in such high levels of preparedness. This trade-off is sometimes referred to as the balance between reliability and cost. The cost of achieving high availability is justified in critical systems, while for less critical systems, a lower level of redundancy and availability may be deemed acceptable due to the lower associated risks and costs.

Name three recent advances that are influencing OS design.

Answers

Answer:

The three recent advances are:

1. Cloud Technology

2. Asynchronous Transfer Mode

3. GUI technology

Explanation:

1. Cloud Technology:

Withe the advent of this technology it has become more convenient to store and access the programs and data over the internet.

The increase in the use of this technology has influenced the Operating system to be designed in a more distributed manner.

2. Asynchronous Transfer Mode:

This mode allows the data transfer by using the methodology of flow control for the transfer of start and stop data bits.

The increased use of ATM for the transfer of data bit stream between components to obtain greater through put  has also influenced the design of the Operating System.

3. Graphic User Interface (GUI technology):

With the help of indicators (visual) and graphical icons, this technology allows the interaction with electronic devices.

The progress in this technology and the interfaces it provided the users with has been through many changes thus influencing the operating system  

to improvise their design thus enabling the smooth User Interface experience.

What is Kerberos?

a.A three-headed dog from the Egyptian mythology

b.A trusted third-party authentication protocol

c.A security model

d.A remote authentication dial in user server

Answers

Answer:

b.A trusted third-party authentication protocol .

Explanation:

Kerberos is an authentication service protocol between the trusted hosts present on an untrusted network for example internet. Kerberos is built in all of the major OS's(Operating Systems) such as Microsoft windows ,Apple OS X,Linux .

Microsoft windows 2000 incorporated Kerberos protocol the default authentication method.

Only a third of all Americans have broadband service at home. Among telecommuters, the proportion is 87 percent.

True

False

Answers

Answer:

True.

Explanation:

The statement is true that only a third of all the Americans have broadband service present at their home and this percentage is 87 percent among the telecommuters.

America has made significant progress in the expansion of high -speed internet access in past several years but 19 million american still don't have broadband.

Suppose Dave drops a watermelon off a high bridge and lets it fall until it hits the water. If we neglect air resistance, then the distance d in meters fallen by the watermelon after t seconds is d = 0.5 * g * t 2 , where the acceleration of gravity g = 9.8 meters/second2 . Write a program that asks the user to input the number of seconds that the watermelon falls and the height h of the bridge above the water. The program should then calculate the distance fallen for each second from t = 0 until the value of t input by the user. If the total distance fallen is greater than the height of the bridge, then the program should tell the user that the distance fallen is not valid.

Answers

Final answer:

To calculate the distance fallen by the watermelon, use the formula d = 0.5 * g * t^2. Ask the user for the number of seconds the watermelon falls and the height of the bridge. Use a loop to calculate the distance fallen for each second and check if the total distance is valid.

Explanation:

To calculate the distance fallen by the watermelon, we can use the formula d = 0.5 * g * t^2, where g is the acceleration due to gravity and t is the time in seconds. The user will be asked to input the number of seconds that the watermelon falls and the height h of the bridge above the water. We can then use a loop to calculate the distance fallen for each second from t = 0 until the value of t input by the user. If the total distance fallen is greater than the height of the bridge, the program should display a message indicating that the distance fallen is not valid. Here is an example code in Python:

import math
def calculate_distance_fallen():
   g = 9.8
   t = int(input('Enter the number of seconds that the watermelon falls: '))
   h = float(input('Enter the height of the bridge above the water (in meters): '))
   
   total_distance = 0
   
   for i in range(t+1):
       distance = 0.5 * g * math.pow(i, 2)
       total_distance += distance
       
       if total_distance > h:
           print('The distance fallen is not valid')
           break
       
       print(f'The distance fallen after {i} second(s) is {distance:.2f} meters')
       
   print(f'The total distance fallen after {t} second(s) is {total_distance:.2f} meters')
calculate_distance_fallen()

. Consider the problem of finding the largest element in a list of n elements. What will be the basic operation of an algorithm to solve this problem?

assignment

addition

looping

comparesn

Answers

Answer:

Comparison.

Explanation:

When we have to find a largest in a list of n elements.First we have to iterate over the list so we can access all the elements of the list in one go.Then to find the largest element in the list we have to initialize a variable outside the loop with the minimum value possible and in the loop compare each element with this value,if the element is greater than the variable assign the element to the variable.Then the loop will find the largest element and it will be the variable.

Two positive integers are said to be relatively prime if their only common divisor is 1. For example, 8 and 9 are relatively prime, whereas 1 25 and 15 are not (because they have 5 as a common divisor besides 1). Write a function that takes as parameters two positive integers and returns whether they are relatively prime or not. Basic python programming

Answers

Answer:

#code in python.

#function that calulate 2 numbers are relatively prime or not

def fun(x,y):

   while(y):

       x,y=y,x%y

   return x

#user input

a=int(input("enter first number:"))

b=int(input("enter second number:"))

#call the function

if(fun(a,b)==1):

   print(" Both numbers are Relatively prime")

else:

   print("Both numbers are Not relatively prime")

Explanation:

Read two numbers from user.Call the function fun() with parameter "a" & "b". In the function, it will perform Euclid algorithm to find the greatest common divisor.If it is 1 then both are relatively prime else both are not relatively prime.

Output:

enter first number:5

enter second number:125

Both numbers are Not relatively prime

enter first number:8

enter second number:9

Both numbers are relatively prime

Suppose that a company offers quantity discounts. If up to​ 1,000 units are​ purchased, the unit price is ​$1010​; if more than​ 1,000 and up to​ 5,000 units are​ purchased, the unit price is ​$9.509.50​; and if more than​ 5,000 units are​ purchased, the unit price is ​$5.505.50. Develop an Excel template using the VLOOKUP function to find the unit price associated with any order quantity and compute the total cost of the order.

Answers

Answer:

Ans. Ready to download, please see the file attached to this document

Explanation:

Note. Consider changing the cell in yellow, does not make sense, it could be 10100 instead of 1010

Hi, to design this sheet, I also used the and(...) function of MS excel, in which you declate that in order to select a certain answer, 2 or more conditions must be true, in our case, if a purchase is up to 1000, the price would be $1010 (consider changing this value, maybe to 10100), if the purchase is more than 1000 and less than 5000, the price is $9,509.50, and if is more than 5000 units, the price would be $5,5005.50.

Please check the formula for further clarifications.

Best of luck.

Final answer:

To calculate unit prices and total cost in Excel with VLOOKUP for quantity discounts, create a lookup table with quantity thresholds and prices, then use the VLOOKUP formula to find the unit price for any order quantity, and multiply this price by the order quantity to find the total cost.

Explanation:

To develop an Excel template that calculates the unit price using quantity discounts with the VLOOKUP function, you'll first need to set up a table with the quantity thresholds and the corresponding unit prices. This table will act as a lookup table for the VLOOKUP function. You will then create a formula that takes an order quantity as input and returns the appropriate unit price based on the quantity thresholds specified.

Here’s an example of how you might structure your table (note that the actual table should be placed in the Excel sheet):

0 units to 1,000 units - $10.10 per unit1,001 units to 5,000 units - $9.50 per unitMore than 5,000 units - $5.50 per unit

To use the VLOOKUP function, you’ll enter a formula like the following in the cell where you want to display the unit price:

=VLOOKUP(order_quantity, lookup_table, 2, TRUE)

After finding the unit price, you can compute the total cost of the order by multiplying the quantity by the unit price derived from the VLOOKUP result:

=order_quantity * unit_price
Other Questions
who was carpet baggers The ____________ is a very popular form of logic used to update a sequential file when three different types of transactions are present.(Points : 2) match and delete rule balance line algorithm bilateral update algorithm simplex sequential file rule How much calcium chloride will react with100mg of soda ash? Predict the sex of humans with different complements of X and Y chromosomes. Twin Primes Conjecture A natural number is called a prime number if it has exactly two factors, 1 and itself. 1 is not a prime number because it has exactly one factor. If a number is not prime it is called composi -List the numbers 1 through 31 and circle the primes. What do you see? -You might notice that some pairs of prime numbers have exactly one composite number between them. Such pairs of prime numbers include 3&5, 11&13, 17&19, 29&31. These pair numbers are called twin primes. -Write your first impression regarding this question: Are there an infinite number of twin primes? Provide a justification for your thinking. -Do a little research on the twin prime conjecture and describe at least one interesting fact ti you find. what must the nurse remember to do when suctioning a patient with tracheostomy 10 kg of saturated solution of a highly soluble component A at 80C is cooled to 30C Calculate the amount of an-hydrous crystals are coming out of the solution Solubility of A at 80*C is 0.8 kg of A 1 kg of water and at 30C is 0.3 kg of A 1 kg of water a) 2.73 kg b) 5.73 kg c) 4.73 kg d) 3.73 kg A man caught a fish. It weighed 5/7kg + 5/7 its own weight what did it weigh 2x+y=4________(1) and x+xy=-2_______(2) solve this simultaneously find X and Y For the following systems (as underlined), determine which of the following conditions apply: open, closed, adiabatic, isolated, isothermal, isobaric, isochoric, or steady-state. a. An ice cube inside a freezer where it has already been for an extended period of time, during which the freezer door is never opened. (3 pts) b. The air inside the tire of a Nascar during the first minute of driving in a race. (3 pts) c. Your body over the last week. What is the solution to this equation x +8=-3 1. The children's LENIENT parents allow them to eat ice cream for dinner and stay up until midnight State a true conclusion.1) If B is between A and C then AB + BC = AC.2) Q is between R and S.Conclusion A boy has 8 red marbles, 2 blue marbles 7 yellow and 3 green. what is the probability for selecting a red marble AND then selecting a green marble? find the quotient of 144 and 12 Consider the following metabolic reaction: 3-Phosphoglycerate 2-Phosphoglycerate G = +4.40 kJ/mol What is the G for this reaction when the concentration of 2-phosphoglycerate is 0.290 mM and the concentration of 3-phosphoglycerate is 2.90 mM at 37C? PROCESS MASS and ENERGY BALANCES A solid material with 15% water by weight is to be dried to 7% water. Fresh air is mixed with recycled air and blown over the solid. Fresh air contains 0.01 kg moisture per kg of dry air and recycled air, which is part of the air leaving the drier, contains 0.1 kg moisture per kg of dry air. Mixed air entering the drier contains 0.03 kg moisture per kg of dry air. Determine the following: 1) (a) The amount of water removed per 100 kg of wet material fed to the drier. (b) The amount of dry air in fresh air per 100 kg of wet material. (c) The amount of dry air in recycled air per 100 kg of wet material. The position of a particle moving along the x-axis depends on the time according to the equation x = ct2 - bt3, where x is in meters, t in seconds, and c and b are positive constants. What are the units of (a) constant c and (b) constant b? Find a formula in terms of c, b, and t of the (c) velocity v and (d) acceleration a. (e) At what time t 0 does the particle reach its maximum x value? Why are some bacteria referred to as indicator microorganisms in ascertaining microbial quality control of products? In terms of your heartbeat, digestion, and glandular functioning, your body is pretty much a well-oiled machine that works even when you are asleep. This is possible due to your __________ nervous system.