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
Nata [24]
3 years ago
11

4. 15 Exact change (College level not sure why it says middle school)

Computers and Technology
1 answer:
sweet [91]3 years ago
6 0

Answer:

def print_change(total_change):#this is also total cents, because integers don't have decimal points, so I can't use dollars as my unit

dollars = int(total_change / 100)

remaining_change = total_change - dollars * 100

quarters = int(remaining_change / 25)

remaining_change -= quarters * 25

dimes = int(remaining_change / 10)

remaining_change -= dimes * 10

nickels = int(remaining_change / 5)

remaining_change -= nickels * 5

pennies = remaining_change

all = {'dollar': dollars, 'quarter': quarters, 'dime': dimes, 'nickel': nickels, 'penny': pennies}

for num in [0, 1, 2, 3, 4]:

coin_type = list(all.keys())[num]

amount = all[coin_type]

if num < 4 and amount > 1 or amount == 0 and num < 4:

coin_type += 's'

elif num == 4 and amount > 1 or amount == 0 and num == 4:

coin_type = 'pennies'

print('\n', amount, coin_type)

while True:

total_change = int(input()) #in cents

print_change(total_change)

Had fun making this one... hope it helps. :)

You might be interested in
Micro sleep is when you ____.
Levart [38]

Microsleep refers to periods of sleep that last from a few to several seconds.

8 0
3 years ago
Read 2 more answers
A customer contacts the help disk stating a laptop does not remain charged for more than 30 minutes and will not charge more tha
fenix001 [56]

Answer:

A. LCD power inverter

B. AC adapter

C. Battery

4 0
3 years ago
a computer technician performed a number of actions to correct a problem. some actions did not solve the problem, but eventually
padilas [110]

The technician should document all that was done to try to solve the problem. A detailed record is a good practice to find solutions.

A detailed record documenting all steps by which a problem was solved is a good practice for technicians.

This documented record will help the computer technician to find the cause the next time.

Clear, accurate records support decision-making and solving problems in any job and profession.

Learn more about detailed records here:

brainly.com/question/6284693

4 0
2 years ago
This tag is used to change the appearance of your text on your web page
zaharov [31]

Answer:

b.font tag

is used to change the appearance of your text on your web page

8 0
3 years ago
Write a program that accepts a phrase of unspecified length on the command line. For example: prompt% letter print Operating Sys
Sedaia [141]

Answer:

Check the explanation

Explanation:

#define _MULTI_THREADED

#include <pthread.h>

#include <stdio.h>

#include <errno.h>

#define           THREADS          2

int               i=1,j,k,l;

int argcG;

char *argvG[1000];

void *threadfunc(void *parm)

{

int *num;

num=(int*)parm;

while(1)

   {

   if(i>=argcG)

   break;

   if(*num ==1)

   if(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u')

   {

   printf("%s\n",argvG[i]);

   i++;

   continue;

   }

    if(*num ==2)

   if(!(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u'))

   {

   printf("%s\n",argvG[i]);

   i++;

   continue;

   }

   sched_yield();

   }

return NULL;

}

int main(int argc, char *argv[])

{

pthread_t            threadid[THREADS];

int                  rc=0;

int                  loop=0;

int arr[2]={1,2};

argcG=argc;

for(rc=0;rc<argc;rc++)

argvG[rc]=argv[rc];

printf("Creating %d threads\n", THREADS);

for (loop=0; loop<THREADS; ++loop) {

     rc =pthread_create(&threadid[loop], NULL, threadfunc,&arr[loop]);

}

for (loop=0; loop<THREADS; ++loop) {

   rc = pthread_join(threadid[loop], NULL);

}

printf("Main completed\n");

return 0;

}

The below attached image is a sample output

3 0
3 years ago
Other questions:
  • Ad designers use movement in order to
    9·2 answers
  • If variable x has value 2 and y has value 2, what is the value of the following Jack expression?
    9·1 answer
  • Which of the following would be an example of a loss of record integrity in a
    12·1 answer
  • Productivity can best be described as:
    5·2 answers
  • Which two fields in an Ethernet frame help synchronize device communica- tions but are not counted toward the frame’s size?
    11·1 answer
  • How do you reduce computer screen flicker
    11·1 answer
  • You are the administrator of a Windows network. When creating a new user account, you specify a security clearance level of top
    8·1 answer
  • What are some hazards of being an astronomer??
    6·1 answer
  • Using pointers and shared memory for IPC, what would you need to add to your code to ensure data integrity?
    15·1 answer
  • What is data science?​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!