Write a program whose inputs are three integers, and whose output is the largest of the three values. Ex: If the input is 7 15 3, the output is: 15

Answers

Answer 1

Answer:  

Here is the C++ program to find the largest of three integers.

#include <iostream> //to use input output functions

using namespace std; //to identify objects like cin cout

int main(){ //start of main function

int integer1, integer2, integer3;  // declare three integers

   cin>>integer1>>integer2>>integer3;  //reads values of three integers variables from user

   if (integer1 >= integer2 && integer1 >= integer3) //if value of integer1 variable is greater than or equal to both integer2 and integers3 values

       cout<<integer1;   //then largest number is integer1 and it is displayed

   else if (integer2 >= integer1 && integer2 >= integer3) //if value of integer2 variable is greater than or equal to both integer1 and integers3 values

       cout<<integer2;  //then largest number is integer2 and it is displayed

   else //in case value of integer3 variable is greater than or equal to both integer1 and integers2 values

       cout<<integer3; } //then largest number is integer3 and it is displayed

Here is the JAVA program to find the largest of three integers.

import java.util.Scanner; //to take input from user

public class Main{

public static void main(String[] args) {//start of main function

Scanner input= new Scanner(System.in); //a standard input stream.

int integer1= input.nextInt();//declare and read value of first integer

int integer2= input.nextInt();//declare and read value of second integer

int integer3= input.nextInt();//declare and read value of third integer

   if (integer1 >= integer2 && integer1 >= integer3) //if value of integer1 variable is greater than or equal to both integer2 and integers3 values

       System.out.println(integer1);   //then largest number is integer1 and it is displayed

   else if (integer2 >= integer1 && integer2 >= integer3) //if value of integer2 variable is greater than or equal to both integer1 and integers3 values

       System.out.println(integer2); //then largest number is integer2 and it is displayed

   else //when value of integer3 variable is greater than or equal to both integer1 and integers2 values

               System.out.println(integer3);  } } //then largest number is integer3 and it is displayed

Explanation:

The program is well explained in the comments attached with each statement of the program. I will explain the program with the help of an examples. Suppose

integer1 = 7

integer2 = 15

integer3 = 3

first if condition  if (integer1 >= integer2 && integer1 >= integer3) checks if value of integer1 variable is greater than or equal to both integer2 and integers3 values. Since integer1 = 7 so it is greater than integer3 = 3 but less than integer2. So this statement evaluates to false because in && ( AND logical operator) both of the conditions i.e integer1 >= integer2 and integer1 >= integer3 should be true. So the program moves to the else if part.

The else if condition else if (integer2 >= integer1 && integer2 >= integer3) checks if value of integer2 variable is greater than or equal to both integer1 and integer3 values. Since integer2 = 15 so it is greater than integer1 = 7 and also greater than integer3 = 3. So this statement evaluates to true as both parts of the else if condition holds true. So the else if part executes which has the statement: cout<<integer2; which prints the value of integer2 i.e. 15 on output screen.

Output:

15

Write A Program Whose Inputs Are Three Integers, And Whose Output Is The Largest Of The Three Values.
Write A Program Whose Inputs Are Three Integers, And Whose Output Is The Largest Of The Three Values.
Answer 2

Answer:

#include <stdio.h>

int main(void) {

 

 int num1;

 int num2;

 int num3;

 printf("Enter three integers: ");

 scanf("%d", &num1);

 scanf("%d", &num2);

 scanf("%d", &num3);

 if (num1 == 0 || num2 == 0 || num3 == 0)

 {

   printf("please input a number greater than zero :)\n");

 }

 if (num1 <= num2 && num1 <= num3)

 {

   printf("%i is the smallest number!\n", num1);

 }

 else if (num2 <= num1 && num2 <= num3)

 {

   printf("%i is the smallest number!\n", num2);

 }

 else

 {

   printf("%i is the smallest number!\n", num3);

 }

 return 0;

}

Explanation:

Alright so let's start with the requirements of the question:

must take 3 integers from user inputdetermine which of these 3 numbers are the smallestspit out the number to out

So we needed to create 3 variables to hold each integer that was going to be passed into our script.

By using scanf("%i", &variableName) we were able to take in user input and  store it inside of num1, num2, and num3.

Since you mentioned you were new to the C programming language, I threw in the first if statement as an example of how they can be used, use it as a guide for future reference, sometimes it's better to understand your code visually.

Basically what this if statement does is, it checks to see if any of the integers that came in from user input was the number zero, it told the user it does not accept that number, please input a number greater than zero.

if (num1 == 0 || num2 == 0 || num3 == 0)

 {

   printf("please input a number greater than zero :)\n");

 }

I used this methodology and implemented the heart of the question,

whichever number is smaller, print it out on the shell (output).

if (num1 <= num2 && num1 <= num3)

^^ here we're checking if the first variable we created is smaller than the second variable and the third ^^

 {

   printf("%i is the smallest number!\n", num1);

   ^^ if it is smaller, then print integer and then print a new line so the next line looks neat ^^

   ( incase if your wondering what "\n" is, its a special character that allows you so print a new line on the terminal, kind of like hitting the return or enter key )

 }

else if (num2 <= num1 && num2 <= num3)

^^ else if is used when your checking for more than one thing, and so for the second variable we checked to see if it was smaller than the first and third variable we created ^^

 {

   printf("%i is the smallest number!\n", num2); < -- and we print if it's smaller

 }

Last but not least:

else

^^ if it isn't num1 or num2, then it must be num3 ^^

 {

   printf("%i is the smallest number!\n", num3);

  we checked the first two options, if its neither of those then we have only one variable left, and thats num3.

 }

I hope that helps !!

Good luck on your coding journey :) ‍


Related Questions

How many bits would be needed to count all of the students in class today? There are 5 children in the class.

Answers

To represent the 5 children as a computer bit, we make use of the equation [tex]2^b = n[/tex]. 3 bits are required to represent the 5 children.

Given that

[tex]n = 5[/tex] ---- number of children

The number of bits (b) is calculated as:

[tex]2^b = n[/tex]

Substitute 5 for n

[tex]2^b = 5[/tex]

Take logarithm of both sides

[tex]\log(2)^b = \log(5)[/tex]

Apply law of logarithm

[tex]b \times \log(2) = \log(5)[/tex]

Make b the subject

[tex]b = \frac{\log(5)}{\log(2)}[/tex]

[tex]b = 2.32[/tex]

The number of bits must be an integer. So, we use the greatest integer closest to 2.32. The integer is 3

So:

[tex]b=3[/tex]

Hence, the number of bits to represent the 5 children is 3.

Read more about bits at:

https://brainly.com/question/5046303

What is the relationship between data, information, business intelligence, and knowledge?

Answers

Answer:

The answer is below

Explanation:

Given the following:

Data is oftentimes described as actual truth or evidence about a situation or condition.

Information, on the other hand, is described as a refined data

Business Intelligence is defined as a combination of several information utilized in the decision-making process.

Knowledge is basically described as a form of intellectual properties, which encompasses a lot of experiences, skills, and creativity.

Therefore, the main relationship between all these is the utilization of these resources to enhance and improve the decision-making process. This is because, the gathered DATA is converted to INFORMATION, which in turn used to build BUSINESS INTELLIGENCE and finally, through the combination of past experiences, skills and talent, leads to a wealth of KNOWLEDGE to enhance and improve the decision-making process.

Which of the following help departments organize unique access controls for access to folders and data files within a department or group so that only those employees who need access to confidential data are granted access?
A. Title-based access controls.
B. Role-based access controls.
C. Administrative access controls.
D. Privacy-based access controls.

Answers

Answer:

B. Role-based access controls

Explanation:

Roll-based access control is a way to control access to the network and to data which depends on the position of employees in a department. This way the permission to access information are granted according to roles that are assigned to employees. This type of access control allows access privileges to employees only to the folders and data files which they need in order to perform their tasks and it does not allow them to access the data or information which is not relevant to them. This helps the department to secure the sensitive information and data files and reduces the risk of data breaches.

Statisticians would like to have a set of functions to compute the mean, median and mode of a list of numbers. The mean is the average of the numbers in the list. The median is the number that would appear at the midpoint of a list if it were sorted. The mode is the number that appears most frequently in the list. Define these functions. Please use the starter code stats.py. Expected output: List: [27, 5, 18, 66, 12, 5, 9] Mode: 5 Median: 12 Mean: 20.285714285714285

Answers

Answer:

Python Programming Language

import statistics

mylist =  [27, 5, 18, 66, 12, 5, 9]

print("Mode: ",statistics.mode(mylist))

print("Median: ",statistics.median(mylist))

print("Mean: ",statistics.mean(mylist))

Explanation:

This line imports stats.py into the program

import statistics

This line defines a list (The example list in the program)

mylist =  [27, 5, 18, 66, 12, 5, 9]

This line uses the defined function to calculate and print the mode

print("Mode: ",statistics.mode(mylist))

This line uses the defined function to calculate and print the median

print("Median: ",statistics.median(mylist))

This line uses the defined function to calculate and print the mean

print("Mean: ",statistics.mean(mylist))

On the planet Sigma, robots excavate chunks of a very precious cristaline. These chunks can be divided into smaller part only on the Earth. Once a month, a spaceship comes to Sigma to bring cristaline to the Earth. The spaceship cannot take more than k pounds of the load. Naturally, it is desirable to take as much cristaline as the spaceship can.

Required:
a. Write an algorithm that will allow bringing the maximal amount of cristaline to the Earth. Prove that it is correct and estimate its time complexity.
b. Write an efficient algorithm that will allow bringing the maximal amount of cristaline to the Earth. Prove that it is correct and estimate its time complexity.

Answers

Answer:

Start the algorithm and check the weight of the ship. Load the crystalline to the ship. Check to see if the ship weighs ship weight + k pound crystalline, if less, add more crystalline. If excess, remove the excess crystalline, but if the weight meets the condition, then take off with the loaded ship to planet sigma.

Explanation:

The algorithm continuously checks the weight of the ship on loading with the calculated sum of the ship and k pound crystalline weight. The ship is able to load the correct maximum amount of crystalline to the planet sigma.

in what ways are hardware and software different? in what ways are the the same?

Answers

Answer:

ANSWER FOR IT!

Explanation: Computer hardware is any physical device used in or with your machine, whereas software is a collection of programming code installed on your computer's hard drive. In other words, hardware is something you can hold in your hand, whereas software cannot be held in your hand.

Answer:

Computer hardware is any physical device used in or with your machine, whereas software is a collection of programming code installed on your computer's hard drive. In other words, hardware is something you can hold in your hand, whereas software cannot be held in your hand.

Similarities between Hardware and Software Development

They have behavior: Users interact with the products in various ways, products interact with other products, and products produce outputs given inputs

They have functional (user-facing) and non-functional (non-user-facing) requirements

They are complex: Any representation of product specifications invariably leads to a tree structure, as major features are decomposed into finer-grained features

Thanks 4 asking ur question. Hope u got it well!!

Through which of the devices listed are we able to connect to wireless networks? Check all that apply.

Answers

Answer:

All the devices enable us to connect to wireless networks.

Explanation:

The complete question is...

Through which of the devices listed are we able to connect to wireless networks? Check all that apply.

Antenna

Smart TV

Telephone

Radio

Antenna allow us connect to wireless microwave signals either terrestrial or satellite based.

Smart TV allows wireless connection to the internet.

Modern digital telephones known as 'mobile phones' allows wireless connection between users.

Modern radios use digital wireless network to terrestrial and satellite transmitters.

We can connect to wireless networks via radios and antennas.

What is the aim of wireless networks?

A wireless network is known to be a type of network that helps to connects computers without the used of network cables.

Note that Computers often uses radio communications to transmit data between one another. A person can communicate directly with other wireless computers via  a wireless radios and antennas..

See options below

Check all that apply.

Antenna

Smart TV

Telephone

Radio

Learn more about wireless networks from

https://brainly.com/question/26956118

What is the ability for a system to respond to unexpected failures or system crashes as the backup system immediately and automatically takes over with no loss of service

Answers

Answer:

The appropriate answer will be "Fault Tolerance".

Explanation:

This relates to and is therefore a device rather than a program with nothing more than a self-contained contingency mechanism that enables uninterrupted supply when key characteristics fail. A system has been regarded as fault-tolerant although this keeps working satisfactory manner throughout the existence of one and sometimes more circumstances of failure.

Which of the following laptop features allows users to overcome keyboard size restrictions?
A. Touchpad
B. Numeric Keypad
C. Fn Key
D. Digitizer

Answers

Answer:

C. Fn Key

Explanation:

The Fn key represents the function key that used for the dual purpose. It is to be activated with the help of shift key. Also, it controls the functions of the hardware i.e. brightness of the computer or laptop screen, volume of the speaker, etc

Also, it overcomes the restrictions with respect to the size of the keyboard

hence, the correct option is c.  

Fn Key

Is a laptop features allows users to overcome keyboard size restrictions.

Effective collaboration requires a proactive and holistic strategy that integrates business goals and technology potential.
a) true
b) false

Answers

Answer:

a) true

Explanation:

Effective collaboration is a form of business organization strategy that is utilized by various firms, which is based on carrying out better collaborative or synergy software and proposes a visionary and holistic technique that incorporates company objectives and technology capability.

Hence, in this case, it is TRUE that effective collaboration requires a proactive and holistic strategy that integrates business goals and technology potential.

I'LL GIVE BRAINLIEST Program to total all numbers in a list: Create an empty list Ask user to enter a number to add to the list. Continue to ask user to enter a number and continue adding the number to the list until user enter “stop” Add all the numbers in the list and display the total

Answers

Answer:

numberlist = []

str = ""

while str != "stop":

 str = input("Enter a number: ")

 if str != "stop":

   try:

     numberlist.append(float(str))

   except:

     print("Ignoring", str)

print("The sum is ",sum(numberlist))

Explanation:

This solution also supports floating point numbers!

Answer:

Explanation:

list = []

while True:

num = input("Enter a number: ")

if num == "stop":

break

list.append(int(num))

total = 0

for i in list:

total += i

print(total)

What is the most important quality of lossless compression?

Answers

Answer:

Text

Explanation:

When a file is being compressed from it original form to a compressed form, it's important that the text retains its unique form or at the very least, it should be similar to its original form

This is so because a little drop in quality can cause distortion to the text and thereby changing its meaning or making it unreadable.

The most important quality of lossless compression is that there is no data loss.

Lossless compression is the use of data compression algorithms or techniques to compress an original data to a compressed data with no data loss in the compression process.

Hence, the contents of the compressed data is identical to the original data, therefore the original data to can be reconstructed from the compressed data.

We can conclude that there should be no loss of data during lossless compression.

You can find more on data compression at: https://brainly.com/question/19878993

A description of information use mapping is to identify opportunities for additional feedback mechanisms.A. TrueB. False

Answers

Answer: True

Explanation: Information mapping could simply be explained as a procedure employed in matching or pitting together relevant articles, information or thoughts on a certain idea or relating to a particular domain. These gathered information are of immense importance in business and other domains as it helps manufactures and service providers with the needed data required to identify consumer wants and available opportunities. Hence information use mapping provide additional feedback opportunities enabling businesses to adjust, provide better services.

Which if the following ribbons in Microsoft word is used to add tables and images

Answers

Answer:

Insert tab

Explanation:

It is the second tab in the Ribbon. As the name suggests, it is used to insert or add extra features in your document. It is commonly used to add tables, pictures, clip art, shapes, page number, etc.

The information gathered by a probe, analyzed locally, and transmitted to a remote network management, is called

Answers

Answer:

Remote Network Monitoring (RMON)

Explanation:

The information gathered by a probe, analyzed locally, and transmitted to a remote network management, is called Remote Network Monitoring (RMON).

The Remote Network Monitoring (RMON) was developed in the early 1990s by Internet Engineering Task Force (IETF), which comprises of operators, network designers, researchers and vendors, saddled with the responsibility of designing, developing and promoting internet standards. It is a standardized method for monitoring, analyzing and troubleshooting network traffic on a remote ethernet transport (typically, through its port) to find network connection issues such as network collisions, dropped packets, and traffic congestion. A Remote Network Monitoring (RMON) is an extension of the Simple Network Management Protocol (SNMP) used to gather and manage informations or data about network systems performance.

In order to remotely monitor and gather informations about networks, a RMON probe which can either be a software or hardware is embedded into a network device with a Transmission Control Protocol and Internet Protocol (TCP/IP) such as a switch or router.

Basically, there are two (2) main versions of the Remote Network Monitoring (RMON);

1. RMON 1.

2. RMON 2.

What feature of a server makes it a potential and likely target of hacker attacks?

Answers

Answer:

The feature of a server that makes it a potential and likely target of hacker attacks is it network capability.

Hackers are interested in attacking as many computers as possible.  Therefore, their best target is a server that serves the networked resources, computers, and systems.  From that point, their malwares can be distributed easily and smoothly to unsuspecting computer stations so that they in turn start replicating the malware and also malfunction.

Explanation:

Bear in mind that a server manages all network resources.  The storage capability resides in a server.  The security settings are usually installed in the server to serve all networked devices and systems.  It is from the server that all systems are administered.  Servers are usually dedicated to their server roles and nothing else.

Encrypt the message ENCRYPTION using a tabular transposition cipher with encryption keyword ONE. If necessary, pad the message with A's. Use only capital letters in your answer. Do not use spaces in your answer.

Answers

Answer:

Encrypted message: CPONYIERTN

Explanation:

Message = ENCRYPTION

keyword = ONE

keyword ONE is of length 3 so the rows are of length 3

Permutation is given by the alphabetical order of the letters in the keyword ONE. Here E appears first in alphabet, then comes N and in last comes O so the order would be 321.

Now the message ENCRYPTION is written in tabular form with width of the rows defined by a keyword ONE

O     N     E

3      2      1

E      N     C

R      Y     P

T       I     O

N

Now this message is read by the column in alphabetic order of the keyword ONE.

Since alphabetic order of E is 1 so the column under E is read first which has the letters:

CPO

Then column under N is read which has the letters:

NYI

In the last the column under O is read which has the letters:

ERTN

So the encrypted message is:

CPONYIERTN

Write a program using integers user_num and x as input, and output user_num divided by x three times. Ex: If the input is: 2000 2 Then the output is: 1000 500 250

Answers

Answer:

The program written in Python is as follows:

user_num = int(input("Number: "))

x = int(input("x: "))

for i in range(1,4):

     user_num = user_num/x

     print(user_num," ")

Explanation:

This line gets user_input from the user

user_num = int(input("Number: "))

This line gets x from the user

x = int(input("x: "))

This line iterates from 1 to 3

for i in range(1,4):

This line divides user_num by x

     user_num = user_num/x

This line prints the result of the division

     print(user_num," ")

Which of the following combines something you know, such as a password, with something you are (a biometric device such as a fingerprint or a retina scan) or something you possess (a smart card or a USB stick)?a. Confidentiality b. Authentication c. Two-factor authentication

Answers

Answer:

c. Two-factor authentication

Explanation:

The type of security measure that is being described is known as Two-Factor authentication. This is a security measure in which an individual is only granted access after successfully presenting two or more pieces of evidence to an authentication mechanism. These two forms of evidence can vary from service to service, for example a company may require that the user enter a password and a fingerprint scan, or may ask for a password and SMS code sent to the individual's phone.

The SmoothWall open source firewall solution uses colors to differentiate networks. Which color indicates the private, trusted segment of a network

Answers

Answer:

Green

Explanation:

The Green color indicates the private, trusted segment of a network.

The Smoothwall open source firewall solution makes use of colors in order to differentiate networks. Other colors like red denote connection to the internet, purple and orange are used to designate DMZs for wireless access points.

Smoothwall is usually configured via web-based GUI and does not really require much knowledge to install or use.

Using the drop-down menus, identify the harmful behavior in each scenario. An IT worker at a government agency tells his friends about the work he is doing for computers aboard spy planes.

Answers

Answer:

✔ national security breach

✔ identify theft

✔ software piracy

✔ sale of trade secrets

✔ corporate espionage

Which of these terms describe a facility that stores hundreds, if not thousands, of servers?
a) KVM
b) switchWeb server
c) Data center
d) SSH server

Answers

Answer:

(c) Data center

Explanation:

A data center is a centralized location that stores several computing and networking devices such as servers, routers, switches, e.t.c. The main purpose of the data center is to ensure the smooth collection, storage, processing, distribution and access of very large amount of data.

They (data centers) can also store and provide web application, email application and instant messaging services and lots of other things.

Because of the massive number of servers they store, they are sometimes regarded to as server farms.

Some data centers in Africa include:

i. Main One.

ii. DigiServ.

iii. Rack Center.

QuickBooks Learn & Support 888-210-2883 - QuickBooks - Intuit,,,

Answers

QuickBooks Learn & Support 888-210-2883 - QuickBooks - Intuit,,,

The move up only one line in Microsoft Word, use the following method: (a) press Ctrl + Home Keys (b) Press Home Keys (c) Press Ctrl + Up Arrow Keys (d) Press Up Arrow Keys

Answers

Answer:

(d) Press Up Arrow Keys

Explanation:

(a) press Ctrl + Home Keys

Incorrect

(b) Press Home Keys

Incorrect

(c) Press Ctrl + Up Arrow Keys

Incorrect

(d) Press Up Arrow Keys

Correct

Explanation:

The move up only one line in Microsoft Word, use the following method:

[tex]\huge{\underline{\underbrace{\mathcal\color{gold}{Answer}}}}[/tex]

press up arrow keys

Steganography renders the message un-intelligible to outsiders by hiding it in a picture or other document.A. TrueB. False

Answers

Answer:

A. True.

Explanation:

The word Steganography is from the Greek word "Steganographia" where "Stego" means cover or concealed and "Graphia" means text/writing.

Steganography can be defined as data that is hidden within data. This simply means that, it is a cybersecurity technique used to hide information in another information and concealing the fact that a communication is in action or taking place.

In Computer science, Steganography is an encryption technique which is used alongside cryptography to cover or conceal the existence of a message (text) and render it un-intelligible to outsiders by transforming the message (text). Therefore, it is generally considered to be an extra-secure method to protect data from unauthorized access, use or piracy of copyright information. It is commonly used for audio, video and image files.

Hence, Steganography renders the message un-intelligible to outsiders by hiding it in a picture or other document.

Why is two way communication important for the new communications network?

Answers

Answer:

The answer is below

Explanation:

Two way communication is a form of communication in which both the sender and receiver exchanges messages over a medium of exchange, which could be through mails, email, telephones etc.

Therefore, Two way communication is important for the new communications network based on various reasons, amongst which are:

1.  It serves as medium or means of getting feedback from consumers on what they want concerning services.

2.  It helps to get or samples opinions of the targeted audience's needs.

3.  It enhances the customers - service providers' cordial relationship in terms of quality service delivery.

Using the format method, fill in the gaps in the convert_distance function so that it returns the phrase "X miles equals Y km", with Y having only 1 decimal place. For example, convert_distance(12) should return "12 miles equals 19.2 km".
1 an AWN def convert_distance (miles): km = miles * 1.6 result = "{} miles equals {_} km". _ return result 7 8 print(convert_distance(12)) # should be: 12 miles equals 19.2 km print(convert_distance(5.5)) # should be: 5.5 miles equals 8.8 km print(convert distance(11)) # Should be: 11 miles equals 17.6 km

Answers

Answer:

Add this statement to the code using format method:

result = "{} miles equals {:.1f} km".format(miles,km)

Explanation:

Here is the complete program:

def convert_distance (miles):

   km = miles * 1.6

   result = "{} miles equals {:.1f} km".format(miles,km)

   return result    

print(convert_distance(12))# should be: 12 miles equals 19.2 km

print(convert_distance(5.5)) # should be: 5.5 miles equals 8.8 km

print(convert_distance(11)) # Should be: 11 miles equals 17.6 km

The format() method is used to format the values of the specified parameters and insert the formatted values into the curly brackets which are called placeholders. The parameters of format() method here are miles and km . The first placeholder is for formatted value of miles variable and second placeholder is for formatted value of km variable. Note that placeholder for km has {:.1f} which means the value of km is rounded to 1 decimal place. For example if the value is 19.23245 then it is displayed up to 1 decimal place as: 19.2

The above program has a method convert_distance that takes miles as parameter and converts the value of miles to km by formula:

km = miles * 1.6

It then displays the output in the specified format using format() method. Now lets take an example:

print(convert_distance(5.5))

The above statement calls the method by passing the value 5.5 So,

miles = 5.5

Now the function converts this value to km as:

km = miles * 1.6

km = 5.5 * 1.6

km = 8.8

Statement: result = "{} miles equals {:.1f} km".format(miles,km) becomes:

{} first place holder holds the value of miles i.e. 5.5

{} second place holder holds the value of km up to 1 decimal place i.e. 8.8

Hence it becomes:

5.5 miles equals 8.8 km

So return result  returns the result of this conversion.

Hence the output is:

5.5 miles equals 8.8 km

The program and its output is attached.

The format method is used to substitute and format output data before they are eventually printed.

The complete statement using the format method is:

result = "{} miles equals {:.1f} km".format(miles,km)

From the question, we understand that the program is to output the converted distance to 1 decimal place.

The function definition receives miles as its argument, while the equivalent distance in kilometers is calculated within the function.

So,

The first blank will be left empty, to output miles unformattedThe second blank will be filled with :.1 , to output km formatted to 1 decimal placeThe third blank will be filled with the output variables i.e. format(miles,km)

Read more about format methods at:

https://brainly.com/question/19554596

If you define CSS rules on a parent control, the rules will be inherited by all of the children widgets.
A. True
B. False

Answers

Answer:

TRUE

Explanation:

Which of the following is true regarding items that are orange on TopHat?a. They are set to review b. You cannot answer the questions for credit but can review the answers c. Interacting with these items has no impact on your grade d. All of the above

Answers

Answer:

d. All of the above

Explanation:

Top Hat is a online tool to that the teachers use to interact and teach their students. It is one of the student engagement platform which the professors use it inside as well as outside of the classroom.

It provides the lecture tool which tracks the attendance of the students, asks them questions, features the interactive slides and also manages the classroom discussions.

The items which are identified as a orange icon on TopHat is for review and see the item content or assignment. It means that you have access it outside the class room and your item is only for review and it will not be graded.

A palindrome is a string that reads the same forward and backward. a substring is a contiguous subset of characters in a string. Given a string s how many distinct substrings of s are palindromes

Answers

Answer:

Here is the Python program to compute how many distinct substrings of a string s are palindromes:

def AllPalindromes(s, l, h, sub):  #function that finds all the palindromes

while l >= 0 and h < len(s) and s[l] == s[h]:  #the loop iterates and reads the s until s[l.h] is a palindrome

 sub.add(s[l: h + 1])  #adds the palindromes to sub

 l = l - 1  #decrements the count of l by 1

 h = h + 1 #increments the count of h by 1

def DistinctPalindromes(s):  #function to find all distinct palindromic substrings of s and also their number

substr = set()  #stores all distinct substrings of s which are palindromes

for i in range(len(s)):  #iterates through s

 AllPalindromes(s, i, i,substr) # find all  palindromes with odd length and with s[i] as mid point

 AllPalindromes(s, i, i + 1, substr) # find all  palindromes with even length and with s[i] as mid point

print("palindromic substrings are",substr, '\n',end='')  # display all distinct palindromic substrings

print(len(substr),"distinct substrings of",s,"are palindromes") # display the number of distinct palindromic substrings

print("Enter a string:")  #prompts user to enter a string

s = input()  #accepts input from user

DistinctPalindromes(s)  #calls DistinctPalindromes method by passing input string to it in order to compute the

Explanation:

The program is well explained in the comments attached with each statement of the code. The function AllPalindromes finds all the palindromes of string s. while loop iterates and reads the string forward and backward to find same i.e. palindrome. Here h and l represents high and low part of the string s. They can also be called as forward and backward pointers to the s characters. The while condition also checks the characters at s[l] position in the string s is equal to the character at s[h].  add() method is used to push all palindromes into the set  sub. The function DistinctPalindromes is used to find all the distinct substrings of s that are palindromes. The loop iterates through characters of string s and calls AllPalindromes method to find all palindromes with odd and even length. It then prints the distinct palindromic substrings . For examples s = "aabaa" then the palindromic substrings are {'aabaa', 'b', 'aba', 'a', 'aa'}  and the number of distinct substrings of aabaa that are palindromes is 5. The program along with its output is attached in a screenshot.

Other Questions
round three significant figures 12.3456 The statement of retained earnings or the statement of stockholders' equity reconciles the net income, dividends paid, and the change in retained earnings during a particular year. Which of the following best describes shareholders' equity? a. Equity is the difference between the paid-in capital and retained earnings. b. Equity is the sum of what the initial stockholders paid when they bought company shares and the earnings that the company has retained over the years. NOW Inc. released its annual results and financial statements. Grace is reading the summary in the business pages of today's paper. In its annual report this year, NOW Inc. reported a net income of $160 million. Last year, the company reported a retained earnings balance of $595 million, whereas this year it increased to $700 million. How much was paid out in dividends this year? a. $265 million b. $4 million c. $55 million d. $280 million In which of the following groups of substances would dispersion forces be the only significant factors in determining boiling points? I.Cl2II.HFIII.NeIV.KNO2V.CCl4 HURRY PLEASEEEEWhy is it reasonable to conclude that this piece of artwas produced in a settled agricultural society rather thana hunter-gatherer tribe?Only an artist with a lot of skill and advanced toolscould create this statue from stone.Artists in permanent settlements were limited in usingonly certain tools to create their art.Only an artist with simple skills in representing thehuman form could produce this figure of stone.Artists in agricultural societies had limited access toresources other than stone for their works of art. Using the slope formula, find the slope of the line through the given points (3,3) and (1,1) 2. Metcalf School has two third-grade rooms (A and B) and two fourth-grade rooms(C and D). Together, rooms C and D have 46 students. Room A has 6 more studentsthan room D. Room B has 2 fewer students than room C. Room D has 22 students.How many students are there altogether in rooms A and B? WILLLLLL GIVEEEEEE BRAINLIESTTTTTTT. Pls don't use google or any web browser Use ''Chronicled'' in a sentence! The weightlifter's internal store of energy decreased when he lifted the bar.The bar's internal store of energy increased by a smaller amount.Explain why. The electric flux through a spherical surface is 1.4 105 N m2/C. What is the net charge (in C) enclosed by the surface? Total Price: The sales tax rate is 8%. If the sales tax on a 10-speed bicycle is $12, what is the purchase price? The purchase price is $ What is the total price? The total price is $ Get Help: Video eBook Points possible: 1 Solve a combined inequality that is a conjunction of two linear equalities.1.) solve for n. -1 Merlyn had 22 magic tricks to perform. He had completed 4/5 of them when the fire alarm sounded. How many magic tricks had he performed? 61. How was the debate over fair representation resolved by the Great Compromise? Explain, in detail, both sides of the debate as well as the terms reached in the Great Compromise. In a survey of 1,003 adults concerning complaints about restaurants, 732 complained about dirty or ill-equipped bathrooms and 381 complained about loud or distracting diners at other tables.a. Construct a 95% confidence interval estimate for the population proportion of adults who complained about dirty or ill-equipped bathrooms )b. Construct a 95% confidence interval estimate for the population proportion of adults who complained about loud or distracting diners at other tables.c. How would the manager of a chain of restaurants use the results of (a) and (b)? Choose the response that shows the commas in the appropriate.They wanted to ride horses go hiking and explore the cave.a. They wanted to ride horses, go hiking, and explore the cave.b. They wanted to, ride horses go hiking and explore the cave.Correct Find the number of ways of arranging the letters of the word MOSHOESHOE, if the letter M must always begin a word What are some examples of proton? Margaret is going to paint a wall that 'is 8 feet high and 15 feet long. How many square feet will she be covering with paint? Select all that apply. What should be included in the conclusion of an argumentative essay? Positive or negative feedback about the argument A restatement of the thesis A summary of the arguments claims A call to arms A call to action how do you think calculator of a computer works? describe the procedure.plz answer quickly its urgent!!!