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
ollegr [7]
2 years ago
11

The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours; any hours worked be

yond 40 are paid at time-and-a-half (one and a half times the hourly rate). given the variables hours, rate, and pay have already been declared and assigned values, write a fragment of code (one or more statements) that assigns to pay the proper value, taking into account time-and-a-half. (basic arithmetic, basic conditional)
Computers and Technology
1 answer:
oee [108]2 years ago
8 0
C# program code;

if (hours <=40)
{
pay = rate * hours;
}
else
{
extra_hours = hours - 40;
pay = 40*rate + extra_hours *rate*1,5;
}
You might be interested in
Convert 234.43 (base 7) to base 10
miss Akunina [59]

Answer:

123.6326

Explanation:

Given number in base 7 : 234.43

Converting to base 10:

Each digit needs to be multiplied by 7^(position index)

Applying this for all the digits in the number:

=2* 7^2 + 3*7^1 + 4*7^0 + 4*7^-1 + 3*7^-2

=2*49 + 3*7 + 4 + 4/7+3/49

=98 + 21 + 4 + 0.5714 + 0.0612

Separating the integer and fraction parts:

=(98 + 21 + 4) + (0.5714 + 0.0612)

=123.6326

So the base 10 equivalent value for 234.43(base 7) is 123.6326

7 0
2 years ago
Write a function flush that takes as input a list of five cards, tests whether it is a flush (Note: straight flush is not a flus
melamori03 [73]

Answer:

Explanation:

ef poker(hands):

   scores = [(i, score(hand.split())) for i, hand in enumerate(hands)]

   winner = sorted(scores , key=lambda x:x[1])[-1][0]

   return hands[winner]

def score(hand):

   ranks = '23456789TJQKA'

   rcounts = {ranks.find(r): ''.join(hand).count(r) for r, _ in hand}.items()

   score, ranks = zip(*sorted((cnt, rank) for rank, cnt in rcounts)[::-1])

   if len(score) == 5:

       if ranks[0:2] == (12, 3): #adjust if 5 high straight

           ranks = (3, 2, 1, 0, -1)

       straight = ranks[0] - ranks[4] == 4

       flush = len({suit for _, suit in hand}) == 1

       '''no pair, straight, flush, or straight flush'''

       score = ([1, (3,1,1,1)], [(3,1,1,2), (5,)])[flush][straight]

   return score, ranks

>>> poker(['8C TS KC 9H 4S', '7D 2S 5D 3S AC', '8C AD 8D AC 9C', '7C 5H 8D TD KS'])

'8C AD 8D AC 9C'

5 0
3 years ago
Shania has started a new job as an app developer. Her first task was to make an old app designed for Android available on other
Fantom [35]

Answer:

B. Use cross-platform tools to write code that will translate the existing Android app code into different native formats.

Explanation:

Cross-platform application development tools are tools that can be used tool generate applications of different platforms, by just writing a single type of code. It has the ability to automatically create an application of a different platform from another.

A developer can develop an application like Android and convert it to IOS for Apple. Xamarin, Appcelerator coroner etc, are all examples of cross-platform tools.

8 0
3 years ago
Which algorithm makes the most efficient use ofmemory?
SashulF [63]

Answer:

Best-fit Algorithm

Explanation:

Best-fit: Allocating the smallest memory location that is greater than or equal to the size of process.

<u>Example</u>

Let these are the memory locations-210kb,310kb,260kb,610kb

                    and size of processes-160kb,450kb,250kb,300kb

For the first-fit,

We allocate 160 kb to the 210kb memory location

Then, we allocate 450 kb to the 610kb because others don't have the size.

Then,we allocate 250kb to the 310 kb.

300 kb will stop,as no memory locations can execute.

For the Best-fit,

We allocate 160 kb to the 210kb memory location

Then,we allocate 450kb to the 610kb.

Then,we allocate 250kb to the  260kb not 310kb according to best-fit.

Then we allocate 300kb to the 310kb.

For the worst fit,

We allocate 160 kb to the 610kb memory location according to the worst-fit algorithm.

Then,we can't allocate 450kb to any memory location.

Then,we allocate 250kb to the 310kb .

We can' allocate 300kb in 260kb memory location.

As we can see from this example that in First-fit algorithm 300kb process will stop as no memory location is there.

In worst-fit algorithm ,We can't allocate 450kb,300kb to any memory locations.

In Best-fit algorithm,we can allocate the process to each location,so this algorithm is using memory in a efficient way.    

5 0
3 years ago
Which of the following events would most likely produce an earthquake
sveticcg [70]

Earthquakes are usually caused when rock underground suddenly breaks along a fault. This sudden release of energy causes the seismic waves that make the ground shake. When two blocks of rock or two plates are rubbing against each other, they stick a little. ... When the rocks break, the earthquake occurs.

8 0
3 years ago
Other questions:
  • A network technician has configured a point-to-point interface on a router. Once the fiber optic cables have been run, though, t
    12·1 answer
  • You save $500 in a retirement account at age 25. it increases an average of 10% per year until you are 65. which formula and res
    13·1 answer
  • What are examples of some Exotic currencies?
    14·1 answer
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • The Quick Access Toolbar cannot be customized and have extra commands added to it
    5·1 answer
  • Define a class, addresstype, that can store a street address, city, state, and zip code. use the appropriate functions to print
    11·1 answer
  • A system administrator is selecting an operating system for use by the company’s research and development team. The team require
    15·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    13·2 answers
  • Is the flow of power reversible in a leadscrew?
    11·1 answer
  • A character that <br>is raised and smaller above the baseline is called​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!