1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ymorist [56]
3 years ago
10

. Carly's Catering provides meals for parties and special events. In Chapter 2, you wrote an application that prompts the user f

or the number of guests attending an event, displays the company motto with a border, and then displays the price of the event and whether the event is a large one. Now modify the program so that the main() method contains only three executable statements that each call a method as follows:
Engineering
1 answer:
klio [65]3 years ago
6 0

Answer:

Explanation:

public class Event

  public final static int PRICE_PER_GUEST = 35;

  public final static int CUT_OFF = 50;

 

  //Attributes

  private String eventNum;

  private int noOfGuest;

  private int price;

 

  /**

  * param eventNum the eventNum to set

  */

  public void setEventNum(String eventNum)

      this.eventNum = eventNum;

 

 

  /**

  * param noOfGuest the noOfGuest to set

  */

  public void setNoOfGuest(int noOfGuest)

      this.noOfGuest = noOfGuest;

      this.price = this.noOfGuest * PRICE_PER_GUEST;

 

 

  /**

  * return the eventNum

  */

  public String getEventNum()

      return eventNum;

 

 

  /**

  * return the noOfGuest

  */

  public int getNoOfGuest()

You might be interested in
An exit sign must be:Colored in a way that doesn’t attract attentionIlluminated by a reliable light sourceAt least 3 inches tall
Ksenya-84 [330]

Answer:

Red

Explanation:

5 0
3 years ago
A step-up transformer has 20 primary turns and 400 secondary turns. If the primary current is 30 A, what is the secondary curren
-BARSIC- [3]
150
A
Explanation:
V
s
V
p
=
N
s
N
p

(
1
)
N
refers to the number of turns
V
is voltage
s
and
p
refer to the secondary and primary coil.
From the conservation of energy we get:
V
p
I
p
=
V
s
I
s

(
2
)
From
(
1
)
:
V
s
V
p
=
900
00
3
00
=
300
∴
V
s
=
300
V
p
Substituting for
V
s
into
(
2
)
⇒
V
p
I
p
=
300
V
p
×
0.5
∴
I
p
=
150
A
Seems a big current.
3 0
2 years ago
You are a designer of a new processor. You have to choose between two possible implementations (called M1 and M2) of the same ar
Kaylis [27]

Answer:

A ) CPI : M1 = 2.4 , M2 = 2.65

B ) MIPS : M1 = 1083, M2 = 1056

C ) The machine that has a better performance based on MIPS is M1 and this is  by 27 million number of instructions per sec

Explanation:

A) The CPI for each machine

CPI = ( Total number of execution cycles ) / ( instruction counter executed )

For Machine 1 ( M1 )

we have to make some assumptions : number of instructions = 10

number of times A was executed = 4 , Number of times B was executed = 2.5 , number of times C was executed = 2.5, Number of times D was executed = 1. and this was based on the frequency given above

hence CPI for M1 =[ ( 1 * 4 ) + ( 3 * 2.5 ) + ( 3 * 2.5 ) + ( 5 * 1 ) ] / 10

       CPI  for M1 = 2.4

For Machine 2 ( M2 )

we have to make some assumptions : number of instructions = 10

number of times A was executed = 4 , Number of times B was executed = 2.  number of times C was executed = 1.5, Number of times D was executed = 2.5 times. and this was based on the frequency given above

Hence CPI  for M1 = [ ( 2 * 4 ) + ( 2 * 2 ) + ( 3 * 1.5 ) + ( 4 * 2.5 ) ] / 10

            CPI for M2 = 2.65

B ) Calculate the native MIPS  ratings for M1 and M2

MIPS = ( instruction counts ) / ( Execution time * 10^6 )

For M1

Assumptions : number of instructions executed = 10

                        each clock cycle = 0.3846 * 10^-9.      frequency = 2.6 Ghz

first we calculate the total execution time which is equal to :

= [ ( 1 * 4 ) + ( 3 * 2.5 ) + ( 3 * 2.5 ) + ( 5 * 1 ) ] * 0.3846 * 10 ^-9

= 9.2304 * 10 ^-9 secs

therefore the MIPS for M1

= 10 / ( 9.2304 * 10^-9 ) * 10^6  = 1083

                                         

For M2

Assumptions : number of instructions executed = 10

                        each clock cycle = 0.3846 * 10^-9.      frequency = 2.8 Ghz

first we calculate the total execution time which is equal to :

= [ (2*4) + (2*2) + (3 * 1.5 ) + ( 4 * 2.5 ) ] * 0.3846 * 10^-9 = 9.4631 * 10^-9 secs

therefor the MIPS for M2

= 10 / ( 9.4631*10^-9) * 10^6 = 1056

C ) The machine that has a better performance based on MIPS is M1 and this is by 27 million number of instructions per sec

8 0
3 years ago
Question Set 22.1 Using the count method, find the number of occurrences of the character 's' in the string 'mississippi'.2.2 In
Gnom [1K]

Answer:

# Program is written in python

# 22.1 Using the count method, find the number of occurrences of the character 's' in the string 'mississippi'.

# initializing string

Stringtocheck = "mississippi"

# using count() to get count of s

counter = Stringtocheck.count('s')

# printing result

print ("Count of s is : " + str(counter))

# 2.2 In the string 'mississippi', replace all occurrences of the substring 'iss' with 'ox

# Here, we'll make use of replace() method

# Prints the string by replacing iss by ox

print(Stringtocheck.replace("iss", "ox"))

#2.3 Find the index of the first occurrence of 'p' in 'mississippi'

# declare substring

substring = 'p'

# Find index

index = Stringtocheck.find(substring)

# Print index

print(index)

# End of program

8 0
3 years ago
Two Carnot engines operate in series such that the heat rejected from one is the heat input to the other. The heat transfer from
kykrilka [37]

Answer:

Given:

high temperature reservoir T_{H} =1000k

low temperature reservoir T_{L} =400k

thermal efficiency n_{1}= n_{2}

The engines are said to  operate on Carnot cycle which is totally reversible.

To find the intermediate temperature between the two engines, The thermal efficiency of the first heat engine can be defined as

n_{1} =1-\frac{T}{T_{H} }

The thermal efficiency of second heat engine can be written as

n_{2} =1-\frac{T_{L} }{T}

The temperature of intermediate reservoir can be defined as  

1-\frac{T}{T_{H} } =1-\frac{T_{L} }{T} \\T^2=T_{L} T_{H} \\T=\sqrt{T_{L} T_{H} }\\T=\sqrt{400*1000} =632k

8 0
3 years ago
Other questions:
  • An equilibrium mixture of 3 kmol of CO, 2.5 kmol of O2, and 8 kmol of N2 is heated to 2600 K at a pressure of 5 atm. Determine t
    7·1 answer
  • Give an example of one technology that is well matched to the needs of the environment, and one technology that is not.
    9·1 answer
  • A force that attempts to decrease the length of a structural member is____
    14·1 answer
  • A(n) _________ is a current greater than the equipment rated current or conductor ampacity, which is confined to the normal cond
    12·1 answer
  • Suppose that the time (in hours) required to repair a machine is an exponentially distributed random variable with parameter ???
    13·1 answer
  • Explain why veracity, value, and visualization can also be said to apply to relational databases as well as Big Data.
    6·1 answer
  • Air is compressed in a well insulated compressor from 95 kPa and 27 C to 600 kPa and 277 C. Use the air tables; assume negligibl
    11·1 answer
  • What quantity measures the effect of change?
    12·2 answers
  • What is the heart of a set of construction drawing?
    10·1 answer
  • A series of end-milling cuts is currently used to produce an aluminum part that is an aircraft component. The purpose of the mac
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!