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
Ilya [14]
4 years ago
11

Octal numbers have a base of eight and the digits 0–7. Write the scripts octalToDecimal.py and decimalToOctal.py, which convert

numbers between the octal and decimal representations of integers. These scripts use algorithms that are similar to those of the binaryToDecimal and decimalToBinary scripts developed in the Section: Strings and Number Systems.
Computers and Technology
1 answer:
Burka [1]4 years ago
4 0

Answer:

See explaination

Explanation:

#input

o_t_n=int(input('Enter a string of octal digits: '))

#required variables

i = 1

dc = 0

#loop for conversion

while (o_t_n != 0):

#to find remainder

rmd = o_t_n % 10

o_t_n //= 10

dc += rmd * i

i *= 8

#print the results

print('The integer value is ',dc)

# decimalToOctal.py

#input

d_c_n=int(input('Enter a decimal integer: '))

print("Quotient Remainder Octal")

#required variables

i = 1

o_c_n = 0

num=""

#loop for conversion

while (d_c_n != 0):

#to find remainder

rm = d_c_n % 8

d_c_n //= 8

o_c_n = o_c_n + rm * i

i *= 10

num = str(rm)+num

print("%5d%8d%12s" % (d_c_n, rm, num))

#print the results

print('The octal representation is ',o_c_n)

You might be interested in
The user interface design principle that places an emphasis on the intuitive flow of the interface (i.e. left to right and top t
SSSSS [86.1K]

Answer: Layout

Explanation: Layout is the basic interface design between the flow in a system that is in compact form so that user can access it easily. It also manages the flow of the interface pattern in whichever direction( top, left, bottom, right ) accordingly in minimal way. It also lets the user take the control over the panel interface that are in the display or may be hidden form.

4 0
3 years ago
Imagery functions as a coding system to help individuals acquire movement patterns. this describes
denis-greek [22]

Answer:

Imagery can be used to develop qualities in yourself you'd like to have — it's like emotional body-building — and using a technique called “Evocative Imagery” you can cultivate courage, patience, tolerance, humor, concentration, self-confidence or any other quality you'd like to embody.

3 0
3 years ago
In project management, which step involves the project manager identifying
nasty-shy [4]

Answer: The only help is your lord and savior Jesus Christ Amen YAR

Explanation: The Bible or Church

8 0
2 years ago
Assume the availability of a function is_prime. Assume a variable n has been associated with positive integer. Write the stateme
My name is Ann [436]

Answer:

def main():

   # Accept data from the user

   n=int(input('Enter the value of n:'))

   k=2;

   sum=0

   print('The list of the prime numbers are as follows:')

   # This loop runs from k to n

   while k<=n:

       # Call is_prime() method,

       # to check whether k is a prime or not

       sum=sum+is_prime(k)

       k=k+1

   print('Sum of the prime numbers:',sum)

# is_prime() Method

def is_prime(k):

   prime=0        

   i=1

   # Check k is a prime or not

   while i<=int(k):

       # Find the factors of k

       if (k % i) == 0:

           prime=prime+1

       i=i+1

   # If k as two factors

   if(prime==2):        

       print(k)

       return k;

   # If k as more than two factors

   else:        

       return 0;

# Call the main() method

main()

Explanation:

5 0
3 years ago
What does ADSL stand for?
vladimir1956 [14]
Asymmetric digital subscriber line (ADSL)
3 0
4 years ago
Read 2 more answers
Other questions:
  • software that instructs the computer how to run applications and controls the display/keyboard is know as the___.
    7·1 answer
  • . Alex discovered a bunch of SATA drives in a box at the office and needs to check the contents. What can he do so that Windows
    13·1 answer
  • A(n) _____ is a type of server that stores computer software, which users can access from their workstations.
    6·1 answer
  • Your customer asks you if it would be worth the investment for him to have Ethernet cabling installed to reach each of his works
    6·1 answer
  • Where is permanent data in the computer stored? Whenever Jim starts his laptop, he sees some commands and numbers appearing on h
    6·1 answer
  • A previously saved labels report can be accessed from the
    9·1 answer
  • A ________ power station uses the energy from a small piece of metal called Uranium ​
    11·2 answers
  • What happens if none of the selector values match selector in a simple case expression in pl/sql
    6·1 answer
  • I need app ideas for basic everyday problems​
    15·1 answer
  • CODEHS: WHY is it important to know the difference between div and span?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!