Python

Write a program that will take a fraction as input and show the first digit of the fractional part of the the number.


Examples:

6.78 results in 7

5 results in no

Answers

Answer 1

The program is illustrated thus based on the information;

import sys

if __name__ == '__main__':

num = float(input('Enter a number: '))

if num < 0.0:

 print('Error! invalid number')

 sys.exit()

digits = int(input('Enter required no. of binary digits: '))

if digits < 0:

 print('Error! invalid digits')

 sys.exit()

num -= int(num)

res = ''

curr = 0

while num != 0 and curr < digits:

 num *= 2

 res += str(int(num))

 num -= int(num)

 curr += 1

print('0.' + res)

How to illustrate the information?

In this program, it should be noted that the program takes a fraction as input.

To illustrate the program, one should define what the program should do and then visualize it on the computer. A model of the program should be created and checked for logical errors.

Then, the program source code will be written and compiled, Any errors found during the compilation is corrected. This depicts how the program is computed.

Learn more about program on:

https://brainly.com/question/26642771

#SPJ1


Related Questions

Need an answer in Python

Write a program for. checking the truth of the statement ¬(X ⋁ Y ⋁ Z) = ¬X ⋀ ¬Y ⋀ ¬Z for all predicate values.

Answers

Using the knowledge in computational language in python it is possible to write a code that checking the truth of the statement ¬(X ⋁ Y ⋁ Z) = ¬X ⋀ ¬Y ⋀ ¬Z for all predicate values.

Writting the code:

def conjunction(p, q):

    return p and q

print("p    q    a")

for p in [True, False]:

    for q in [True, False]:

        a = conjunction(p, q)

        print(p, q, a)

def exclusive_disjunction(p, q):

    return (p and not q) or (not p and q)

print("p    q    a")

for p in [True, False]:

    for q in [True, False]:

        a = exclusive_disjunction(p, q)

        print(p, q, a)

See more about python at brainly.com/question/18502436

#SPJ1

A compound conditional is a type of selection that uses statements with _______3_____ or more logical conditions.

Answers

A compound conditional is a type of selection that uses statements with AND 3 OR or more logical conditions.

What is decision process?

Selection structures are statements that use conditions to choose which group of statements to run. Only when a given circumstance is met is a specific action taken; otherwise, it is not.

Hence, It is possible to test two conditions with compound conditionals in a single sentence. In Blockly, there are two ways to complete this with just one block! You can check to see if a statement's two conditions are true or just the first one.

Learn more about compound conditional from

https://brainly.com/question/29406811

#SPJ1

which of the following compliance standards was introduced to provide a minimum degree of security to organizations who handle customer information such as debit card and credit card details daily?
a. PCIDSS
b. SOX
c. FISMA
d. GLB

Answers

A.) PCIDSS

Is used to handle,store and that has information regarding the details of debit card and credit card details in a safe and secure environment.

In golf, par represents a standard number of strokes a player needs to complete a hole. Instead of using an absolute score, players can compare their scores on a hole to the par figure. Families can play nine holes of miniature golf at the Family Fun Miniature Golf Park. So that family members can compete fairly, the course provides a different par for each hole based on the player’s age.

Pars by Age and by Hole

Develop the logic for a program that accepts a player’s name, age, and nine-hole score as input. Display the player’s name and score on each of the nine holes, with one of the phrases Over par, Par, or Under par next to each score.

Answers

Using the knowledge in computational language in pseudocode it is possible to write a code that accepts a player’s name, age, and nine-hole score as input.

Writting the code:

groups={4:[8, 8, 9, 7, 5, 7, 8, 5, 8],5:[7, 7, 8, 6, 5, 6, 7, 5, 6],8:[6, 5, 6, 5, 4, 5, 5, 4, 5],

12:[5, 4, 4, 4, 3, 4, 3, 3, 4],16:[4, 3, 3, 3, 2, 3, 2, 3, 3]}

print(groups[4][3])

n=int(input("Enter No.of players"))

player_list=[]

scores={}

for i in range(n):

player_list.append([input("name"),int(input("age"))])

for i in player_list:

lst=[]

for j in range(9):

print("Score for hole ",j+1)

lst.append(int(input("")))

scores[i[0]]=lst

for i in player_list:

index=0

See more about pseudocode at brainly.com/question/13208346

#SPJ1

what represents a user’s specific preferences?

Answers

The factor that represents the user's specific preference is the profile. (Option B)

What is userspecific prefernece?

Configure user preferences to indicate parameters that may be adjusted for a specific user. Each user of the Cram program is given a set of DefaultPreferences. The web client has a user preferences editor. This editor allows each user to change the preferences values.

Cookies, which are saved in Web client browsers, are used to store customized preferences. As a result, if you approach the server using a browser other than the one for which you set up cookies, your preferences will be lost.

Learn more about User Specific Preferences:
https://brainly.com/question/24143212
#SPJ1

Full Question:

What represents a user's specific preferences?

Permissions

Profile

Algorithmic Personal Outline

User Preferences

One of your colleagues, and good friends, is a technical application architect and has been instrumental in architecting the core infrastructure that runs some of the most important processes for your company. He is widely acknowledged as a technical Subject Matter Expert (SME) by his peers. You run into him one day at lunch and he tells you: "I don't care what Gartner and Forrester think, data cannot be secure in the cloud. The cloud is inherently less safer than our own data centers" What would you tell your colleague that makes him rethink his position on data security in the Cloud?

Answers

The Subject Matter Expert (SME) must understand that for starters, cloud servers are often housed in warehouses that most employees do not have access. Second, all files on cloud servers are encrypted. This means they are jumbled, making it far more difficult for thieves to access them. Hence data on the cloud is relatively more secure.

What are Cloud Servers?

A cloud server is a pooled, centralized server resource that is hosted and distributed across a network—typically the Internet—and may be accessed by numerous users on demand. Cloud servers may provide all of the same services as traditional physical servers, including processing power, storage, and applications.

Because any software faults are isolated from your environment, a cloud server provides the business user with reliability and security. Other cloud servers will have no effect on your cloud server, and vice versa. Unlike physical servers, if another user overloads their cloud server, this has no effect on your cloud server.

Cloud servers are reliable, quick, and secure. They avoid the hardware concerns that physical servers have, therefore they are likely to be the most dependable solution for organizations that wish to keep their IT spend as low as possible.

Cloud servers offer better service for less money. You'll receive more resources and a quicker service than you would with a physical server at comparable pricing. A website hosted in the cloud will load quicker.

Cloud servers provide scalability. It is relatively simple and quick to upgrade by adding memory and storage space, and it is also less expensive.

Learn more about data Security:
https://brainly.com/question/28321601
#SPJ1

A small piece of data that some websites save which contains information such as websites that you visited and everything you clicked is called

Answers

A small piece of data that some websites save which contains information such as websites that you visited and everything you clicked is called  cookie.

What is a piece of data about a user from a website?Cookies are little data files that websites save on the user's device. Cookies are frequently used by websites to remember user preferences and provide a personalized experience, as well as to gather information for advertising purposes.Cookies, often known as "HTTP cookies," are little text files stored on your computer by websites to assist track your activities. The majority of cookies are used to keep track of the sites you're logged in to and your local settings on those sites.Cookies are text files that include small amounts of data, such as a login and password, and are used to identify your machine when you connect to a computer network. HTTP cookies are used to identify unique users and to improve your web browsing experience.

To learn more about  Cookies refer,

https://brainly.com/question/1308950

#SPJ1

why dose it go to a new tab when I look something up?

Answers

Answer:

Try opening Terminal and pasting this in:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool false

"In a(n) ________ database, any action on one element immediately affects the elements related to it.
A) Hierarchical
B) Multidimensional
C) Object-Oriented
D) Relational"

Answers

In Hierarchical database, option A, any action on one element immediately affects the elements related to it.

What is the purpose of a hierarchical database?

Geographical data and file systems are the two main uses of the hierarchical structure in modern computing. Currently, hierarchical databases are still frequently used, particularly in applications like banking, healthcare, and telecommunications that demand extremely high performance and availability.

Therefore, A data model in which the data are arranged in a tree-like form is called a hierarchical database model. The information is kept in records that are linked to one another by links. A record is a group of fields, each of which has a single value.

Learn more about Hierarchical database from

https://brainly.com/question/13261071
#SPJ1

What is the error in the following pseudocode?

// This program displays the highest value in the array.

Declare Integer SIZE = 3

Declare Integer values[SIZE] = 1, 3, 4

Declare Integer index

Declare Integer highest



For index = 0 To SIZE − 1

If values[index] > highest Then

Set highest = values[index]

End If

End For

Display "The highest number is ", highest

Answers

The error is in line 4: Declare Integer highest

Answer:

The error in the pseudocode is that the variable "highest" is not initialized to any value before the for loop starts. This means that when the first comparison is made in the if statement, the value of "highest" will be undefined and could potentially cause unexpected behavior. To fix this error, the variable "highest" should be initialized to a value before the for loop, such as the first element in the array:

Declare Integer SIZE = 3

Declare Integer values[SIZE] = 1, 3, 4

Declare Integer index

Declare Integer highest = values[0] // Initialize highest to the first element in the array

For index = 1 To SIZE - 1 // Start loop from index 1, since highest is already initialized to index 0

If values[index] > highest Then

Set highest = values[index]

End If

End For

Display "The highest number is ", highest

Explanation:

Jamal wants to download a software program that is free to use. What should he do?

Jamal should download the software from ??? and should then ???.
The Free website] install the software]
a reputable website] scan the download for viruses]
the first pop-up] copy the download on a flesh drive]

please just please help me

Answers

Answer:

The Free website] install the software]

a reputable website] scan the download for viruses]

THIS is the correct answer I think

Which of the following best describes the purpose of a design specification?
A. Tracking errors that arise through user testing
B. Documenting comments that will need to be added to a program
C. Describing the requirements for how a program will work or users will interact with it
D. Listing detailed questions that will be asked of users during interviews

Answers

The answer is B). Documenting a comments that will need to be added to a program on your computer and also a phone too

What are the messages that show up in a successful compilation of QBasic Program?

Answers

Answer:

The END statement is used to terminate a program . It is used as the last statement of a program and it is an optional statement .

Explanation:

i think

Which of the following statements generates a random number between 0 and 50?

Choices;

a. srand(time(0));

num = rand() % 50;

b. srand(time(0));

num = rand()50;

c. srand(time(10));

num = rand() % 50;

d. srand(time(10));

num = rand()/50;

Answers

Srand(time(0)); num = rand() %50 is statements generates a random number between 0 and 50

What are the functions of time and Srand?A distinct sequence results from changing the seed value. The computer's internal clock is used by srand(time(NULL)); to regulate the seed selection. The seed is always changing since time is a moving target.Time(0) provides the amount of time in seconds since the Unix epoch, making it a decent "unpredictable" seed (you can be sure your seed will only be the same once, unless you run your application more than once in the same second).Because the rand() function always produces the same sequence of numbers, the results are not truly random.

To learn more about Srand refer to:

https://brainly.com/question/16792424

#SPJ1

which statement can be used to handle some of the runtime errors in a program?
a. a try statement
b. a try/except statement
c. an exception statement
d. an exception handler statement

Answers

Answer:

B

Explanation:

The answer is B, a try/except statement. This can be used to handle some of the runtime errors in a program.

Which of the following is NOT a valid SQL Comparison Operator in the WHERE clause? O a) <> b) != Oc c) NOT BETWEEN d) IS NOT NULL

Answers

B.)!

The exclamation point (!) has the same functionality as the NOT operator.

you have a layer 3 switch that is capable of intervlan routing. which process must you complete to allow intervlan routing on a layer 3 switch interface?

Answers

A process which you must complete to allow interVLAN routing on a Layer 3 switch interface is configuring the interface as a switch virtual interface.

What is a switch?

A switch can be defined as a network device which is designed and developed for the programmatic redirection of request traffic of a client from one server.

What is a Layer 3 switch?

In Computer networking, a Layer 3 switch can be defined as a type of network device that is designed and developed to use ASICs to handle packet switching for interVLAN routing (communication) on an active network.

This ultimately implies that, a Layer 3 switch must be configured as a switch virtual interface in order to enable interVLAN routing (communication).

Read more on switch here: brainly.com/question/14850209

#SPJ1

flow chart to read 50 numbers and print summation of even numbers only

Answers

The sum of terms in an arithmetic progression formula is used to get the sum of even numbers formula. Sum of Even Numbers Formula is written as n(n+1), where n is the total number of entries in the series.

What is print summation of even numbers only?

Python comes with a built-in method called sum() that adds up the values in the list. Syntax: sum (iterable, start) (iterable, start) Iterable:

Most importantly, iterable should be numbers. Start: This start is added to the total of the iterable's numbers.

Therefore, By definition, when a number is divided by two, there is never a remainder. There will therefore be no residue when it is added to another even integer.

Learn more about summation here:

https://brainly.com/question/29334900

#SPJ1

what member of an organization should decide where the information security function belongs within the organizational structure? why?

Answers

Answer:

Chief Information Officer (CIO) should be responsible for the overall management of information and data within the organization, and as such, is in the best position to understand the risks and vulnerabilities associated with this information.

The CIO can ensure that the information security function is able to effectively protect the organization's information and data, while also supporting the organization's business objectives.

a support technician is installing a new sata hard drive on a new computer. what is the best type of cable connector the technician will plug in to supply power to the drive

Answers

Thee best type of cable connector the technician will plug in to supply power to the drive is a 15-pin connector.

What is a cable connector?

The part you attach to the end of a cable so it can plug into a port or an interface of an electrical system is called a cable connector. Most connectors fall into one of two genders: male or female. Male connectors have one or more exposed pins, while female connectors have holes for the male pins to fit into.

Therefore, For computer visual output, there is a standard connector called the Video Graphics Array (VGA). The 15-pin connector was first used with the 1987 IBM PS/2 and its VGA graphics technology, and it later appeared on many monitors, projectors, and high-definition televisions.

Learn more about cable connector from

https://brainly.com/question/29387419
#SPJ1

Write a complete Java program that prompts the user to input two integer values and outputs the largest and smallest numbers. The program includes JOptionPane for both the input and output statements.

Answers

Using the knowledge in computational language in JAVA  it is possible to write a code that complete Java program that prompts the user to input two integer values and outputs the largest and smallest numbers.

Writting the code:

import javax.swing.JOptionPane;

public class Main

{

public static void main(String[] args) {

     String firstNumber = JOptionPane.showInputDialog("Enter first integer");

     String secondNumber = JOptionPane.showInputDialog("Enter second integer");

     int number1 = Integer.parseInt(firstNumber);

     int number2 = Integer.parseInt(secondNumber);

     

     int largestNumber = Math.max(number1, number2);

     int smallestNumber = Math.min(number1, number2);

     

     JOptionPane.showMessageDialog(null, "Largest Number is: " + largestNumber + "\nSmallest Number is :" + smallestNumber);

}

}

See more about JAVA at brainly.com/question/12975450

#SPJ1

Choose the parts of the browser window.
1. [ web form, keyword list, pliers, status bar ]
2. [ url repo, scissors tool, display window, mail bar ]
3. [ exclamation bar, address bar, menu button, lucky button ]
4. [ title bar, back button, forward bar, enter bar ]

Answers

Answer:

It's number 4.

Explanation:

In your browser you have a title bar, where you input the web address or search query. You have the Forward and Back button to navigate between the history of the current tab.

The other guy didn't even try sorry about that :/

My best guess is the following

1.

keyword list

2.

display window

3.

address bar

4.

back button

A specialized database programming language.is ____ a. C++ b. C# 20 c. Java d. SQL

Answers

A specialized database programming language is SQL. The correct option is d.

What is SQL?

SQL (Structured Query Language) is one of the most well enough and longest-running database languages.

It includes data definition and data manipulation languages, as well as the ability to write queries in a database.

C#, C++, and JAVA are programming languages created by, whereas SQL is a database query language created by Oracle for creating and managing databases.

Structured Query Language (SQL) is a programming language that is used to manage relational databases and perform various operations on the data contained within them.

Thus, the correct option is c.

For more details regarding SQL, visit:

https://brainly.com/question/13068613

#SPJ1

¿Que ess ready player one?

Answers

The interpretation or translation of the following phrase is: "Are you ready player one?"

Why are translations important?

Translation is necessary for the spreading new information, knowledge, and ideas across the world. It is absolutely necessary to achieve effective communication between different cultures. In the process of spreading new information, translation is something that can change history.

In this example, it is possible that a flight simulation has just displayed the above message. It is important for the trainee in the simulator to be able to interpret the following message.

Learn more about interpretation:
https://brainly.com/question/28879982
#SPJ1

Full Question:

What is the interpretation of the following:
¿Que ess ready player one?

Operations security requires the implementation of physical security to control which of the following?

A. Unauthorized personnel access

B. Incoming hardware

C. Contingency conditions

D. Evacuation procedures

Answers

Answer:

A. unauthorized personnel access

Explanation:

like key card readers to control the opening of doors.

Five Star Retro Video rents VHS tapes and DVDs to the same connoisseurs who like to buy LP record albums. The store rents new videos for $3.00 a night, and oldies for $2.00 a night.

Write a program that the clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals.

The program should prompt the user for the number of each type of video and output the total cost.

An example of the program input and output is shown below:

Enter the number of new videos: 3
Enter the number of oldies: 2

The total cost is $13.0

Answers

The clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals is of three types.

What is Five Star Retro Video ?

The same discerning individuals who enjoy purchasing LP record albums may rent VHS tapes and DVDs from Five Star Retro Video. The shop offers current DVD rentals for $3.00 per night and vintage titles for $2.00 per night.

n1 is same to eval(input("Enter the number of new videos: "))

Enter the number of seniors in the box below.

print("The whole expense is $%.1f"%(n1*3+n2*2))

Thus, the clerks at Five Star Retro Video can use to calculate the total charge for a customer’s video rentals is of three types.

To learn more about  Five Star Retro Video, refer to the link below:

https://brainly.com/question/13138157

#SPJ1

8
Among the structural semantic elements, which of these elements represents a section of content that is independent of a web page or site content?
a) section
b) article
c) header
d) aside

Answers

The elements represents a section of content that is independent of a web page or site  is article

What is meant by web page ?

A web page is a straightforward document that a browser can see. These publications are created using the HTML coding system (which we look into in more detail in other articles). A web page can incorporate many various sorts of resources, including style data, which governs the appearance and feel of the page.

A web page is a document that may be found online. A web browser can be used to view web pages that are stored on a web server. Huge amounts of text, graphics, audio, video, and hyperlinks can all be found on a single web page. To other web pages, use these hyperlinks.

To learn more about web page refer to:

https://brainly.com/question/28431103

#SPJ1

The elements represents a section of content that is independent of a web page or site  is article.

What is meant by web page ?A web page is a straightforward document that a browser can see. These publications are created using the HTML coding system (which we look into in more detail in other articles). A web page can incorporate many various sorts of resources, including style data, which governs the appearance and feel of the page.A web page is a document that may be found online. A web browser can be used to view web pages that are stored on a web server. Huge amounts of text, graphics, audio, video, and hyperlinks can all be found on a single web page. To other web pages, use these hyperlinks.

To learn more about Web page refer to:

https://brainly.com/question/28431103

#SPJ1

all of the following are popular linux distributions, except:_______.
A. Red Hat
B. Ubuntu
C. Debian
D. Deviant

Answers

The option that are popular Linux distributions, except option D. Deviant.

What does Linux distribution refer to?

A Linux distribution, also known as a "Linux distro," is a version of the free and open-source Linux operating system that includes additional software, such as the KVM hypervisor, as well as installation programs, management tools, and other software.

Therefore, There are commercially supported distributions like Fedora (Red Hat), openSUSE (SUSE), and Ubuntu (Canonical Ltd.), as well as distributions that are solely community-driven like Debian, Slackware, Gentoo, and Arch Linux.

Learn more about Linux distributions from

https://brainly.com/question/13139061
#SPJ1

"Which of the following is a true statement regarding privacy?
An individual’s right to control the use of and disclosure of personal information
Private personal information may become public under the Freedom of Information Act
A security service we provide to our customers
All of the above"

Answers

A true statement regarding privacy is that: A. An individual’s right to control the use of and disclosure of personal information.

What is a PII?

PII is an abbreviation for personally identifiable information and it can be defined as any type of information that can be used by individuals or business organizations (companies) on its own or with other relevant data, so as to identify an individual.

This ultimately implies that, all personally identifiable information (PII) connotes the privacy of an individual and as such, they are under the control of individuals with the exclusive right on whether or not to be disclosed others.

Read more on PII here: https://brainly.com/question/28165974

#SPJ1

"Which of the following is a true statement regarding “privacy”?
An individual’s right to control the use of and disclosure of personal information
Private personal information may become public under the Freedom of Information Act
A security service we provide to our customers
All of the above"

Answers

The statement  regarding  privacy  is An individual’s right to control the use of and disclosure of personal information.

What is meant by privacy ?

It has to do with a person's capacity to decide for themselves when, how, and why others handle their personal information. To ensure human dignity, safety, and self-determination, privacy must be protected. People are able to freely create their own personalities.

In general, the right to privacy refers to the freedom from interference or intrusion and the right to be left alone. The right to some level of control over the collection and use of your personal information is known as information privacy.

Human dignity and other fundamental principles like free speech and association are supported by privacy. It is currently one of the most crucial human rights issues in history. This report's release is a reflection of the fundamental right's expanding significance, diversity, and complexity.

To learn more about privacy refer to:

https://brainly.com/question/27034337

#SPJ1

Other Questions
What are the 3 three basic process of approach to gene therapy?. which of the following compliance standards was introduced to provide a minimum degree of security to organizations who handle customer information such as debit card and credit card details daily?a. PCIDSSb. SOX c. FISMA d. GLB What are the factors of personal safety?. gordon employs josh as an agent to sell gordon's house. when does this agency end if the agreement is silent? Will you recommend folk dancing as a form of exercise Why?. Which federal act makes it illegal to send unsolicited commercial solicitations via fax without the recipient's permission or an established relationship?Do Not Call Implementation Act of 2003CAN-SPAM Act of 2003Anti-Telemarketer Act of 2000Junk Fax Prevention Act of 2005Junk Fax Prevention Act of 2005 b. if connie receives a 5 percent profits interest only, how much income must she report, and what is her tax basis in the llc interest? 1.Courageous2. The film is going to be3. A good leader4. We need to5. Who is in the6. My parents teach me to7. The royal palace was filled with8. Kyrgyzstan is famous for its beautiful9. The First Teacher isin the 1920s.10. Zuura was against thepeople take risks and become successful.very soon.a country.our natural environment.?for my own mistakes.in a small Kyrgyz villageof her sister. for an object moving in uniform circular motion, select the quantities that are 0 over one revolution. a 2 kg ball is revolving 35 times per minute around a circle with a 25 cm radius. what is the centripetal force? unless otherwise stated in the nec, rules affecting conductors are based on which type of conductors? What is the Citizenship Clause of the 14th Amendment?. g arrange the following groups of atoms in order of a). increasing size, b). ionization energy, c). electron affinity. a. rb, na, be b. sr, se, ne c. fe, p, o walmart has central distribution centers where goods are received, stored, and prepared for reshipment. the activities involved in operating these distribution centers is called . Describe the ties between leadership in physical activity programs and power relationships based on gender, race and ethnicity, and socioeconomic status.-Gender: percentage decrease of female coaches of female high school and intercollegiate teams and in the proportion of female administors heading women's intercollegiate programs.-Race and ethnic: few African Americans reach important sport leadership positions, even in team sports that feature many African American players-Socioeconomic: wealthy people occupy influential leadership positions in our popular spectator sports and in some physical activities. Those at the lowest levels of socioeconomic status rarely find themselves in positions of leadership. What country exports the most bananas to the US?. a(n) is a homogenous volume of air defined based on its temperature, and moisture characteristics. colleen farney at teletech shows vast knowledge and keen decisiveness. these qualities are part of the category of personal characteristics of leadership. a. intelligence and ability b. physical characteristics c. social characteristics d. social background e. personality According to the article, the right and wrong ways to manage up, what percentage of companies spent more than $1,000 a person annually to train senior leaders?. If a multinational firm is unable to understand how the acquired company's assets would fit with their own lines of business, this can lead to a) expansion; b) divestiture; c) cost savings; d) acquisition