answer.
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
IRISSAK
2 months ago
6

Some numbers are formed with closed paths. the digits 0, 4, 6 and 9 each have 1 closed path and 8 has 2. None of the other numbe

rs is formed with a closed path. Given a number determine the total number of closed paths in each of its digits combined.
Computers and Technology
1 answer:
Natasha_Volkova [1K]2 months ago
5 0

Answer:

def cal(n):

s=0

while n>0:

r=n%10

if(r==0 or r==4 or r==6 or r==9):

s+=1

elif r==8:

s+=2

n=n//10

print(s)

n=int(input("enter number:"))  

print(n)

cal(n)

Explanation:

  • A function is defined to calculate the number of closed paths.
  • A variable is initialized to hold the count of these paths.
  • As long as the number remains positive , retrieve the last digit of n.
  • Trim the last digit to shorten the number.
  • Invoke the function to find the path count.
You might be interested in
(Java) Which of the following code segments correctly declare a Strings and gives it a value of "fortran".
maria [1035]

Response:

IT F

Clarification:

8 0
1 month ago
The Coins class was created to hold all your loose change, kind of like a piggy bank! For this exercise, you are going to simula
Amiraneli [1052]

Answer:

Coins c1 = new Coins (4, 3, 2, 1);

c1.bankValue();

c1.addQuarter();

c1.addQuarter();

c1.addDime();

c1.addDime();

c1.addPenny();

c1.bankCount();

c1.bankValue();

Explanation:

8 0
27 days ago
OCR Land is a theme park aimed at children and adults. Entrance tickets are sold online. An adult ticket to OCR Land costs £19.9
Rzqust [1037]

Answer:

count = 0

while count!= 8:

height = float(input("Enter the height of the rider: "))

if height >= 140:

print("You may ride")

count += 1

else:

if height >= 120:

answer = input("Is the rider accompanied by an adult (yes/no): ")

if answer == "yes":

print("You may ride")

count += 1

else:

print("You are not permitted to ride")

else:

print("You are not permitted to ride")

Explanation:

Begin with a count of zero, which will track the number of riders allowed. Use a while loop that continues until the count reaches 8. During each iteration, request the user's height. If the height is 140 cm or taller, display "You may ride" and increment the count. If the height is 120 cm or more, check if the rider is with an adult. If not, show the message "You are not permitted to ride"; otherwise, allow the ride and increase the count. If the height is below 120 cm, deny the ride.

5 0
1 month ago
The budget process which emphasizes the achievement of goals and competition between alternatives is:
Rzqust [1037]

The question offers several choices;


<span>A) </span>Incremental budgeting.
B) Performance budgeting.
C) Program budgeting.
D) Target based budgeting.


I'd argue that D is the correct option; Target based budgeting.


Target based budgeting centers on achieving objectives and competing alternatives. This budgeting approach uses pricing as a strategic tool to influence sales outcomes. It involves market research to determine the precise selling price of a product.






4 0
1 month ago
In Section 8.5.4, we described a situation in which we prevent deadlock by ensuring that all locks are acquired in a certain ord
8_murik_8 [964]

Answer:

Refer to Explanation

Explanation:

Dividing this critical section into two parts:

void transaction(Account from, Account to, double amount)

{

Semaphore lock1, lock2;

lock1 = getLock(from);

lock2 = getLock(to);

wait(lock1);

withdraw(from, amount);

signal(lock1);

wait(lock2);

deposit(to, amount);

signal(lock2);

}

This approach is optimal in practice, as separating the critical section avoids any unintended states (for instance, resulting in withdrawing more funds than available).

The straightforward solution of keeping the critical section intact lies in ensuring that locks are acquired in the same order across all transactions. In this scenario, the locks can be sorted, choosing the smaller one to lock first.

4 0
1 month ago
Other questions:
  • . Electricians will sometimes call ______ "disconnects" or a "disconnecting means."
    12·1 answer
  • java methods Write a program whose input is a character and a string, and whose output indicates the number of times the charact
    10·1 answer
  • Explain how abstraction is used in a GPS system
    12·2 answers
  • Susan is assisting a web designer to create a promotional web page on eco-friendly classroom designs. She uses color combination
    5·1 answer
  • More Loops: All versions of foods.py in this section have avoided using for loops when printing to save space. Choose a version
    13·1 answer
  • Write a program with total change amount as an integer input, and output the change using the fewest coins, one coin type per li
    11·1 answer
  • What type of memory can support quad, triple, and dual channels?
    5·1 answer
  • This question refers to a standard deck of playing cards. If you are unfamiliar with playing cards, there is an explanation in P
    10·2 answers
  • Define a new object in variable sculptor that has properties "name" storing "Michelangelo"; "artworks" storing "David", "Moses"
    12·1 answer
  • When long labels are required, which of these commands can you use to improve readability of a worksheet?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!