Write a function that takes as input two parameters: The first parameter is a positive integer representing a base that is guaranteed to be greater than 1. The second parameter is an integer representing a limit. The function should return a list containing all of the non-negative powers of the base less than the limit (not including the limit). The powers should start at base^0=1 and increase from there until the limit. If the limit is less than 1 the functions should just return an empty list

Answers

Answer 1

Answer:

Written in Python:

def powerss(base, limit):

   outputlist = []

   i = 1

   output = base ** i

   while limit >= output:

       outputlist.append(output)

       i = i + 1

       output = base ** i

   return(outputlist)

Explanation:

This declares the function

def powerss(base, limit):

This creates an empty list for the output list

   outputlist = []

This initializes a counter variable i to 1

   i = 0

This calculates base^0

   output = base ** i

The following iteration checks if limit has not be reached

   while limit >= output:

This appends items to the list

       outputlist.append(output)

The counter i is increased here

       i = i + 1

This calculates elements of the list

       output = base ** i

This returns the output list

   return(outputlist)


Related Questions

The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09036) + (Heart Rate x 0.6309) — 55.0969 ) x Time / 4.184 Women: Calories = ( (Age x 0.074) — (Weight x 0.05741) + (Heart Rate x 0.4472) — 20.4022 ) x Time / 4.184 Write a program with inputs age (years), weight (pounds), heart rate (beats per minute), and time (minutes), respectively. Output calories burned for men and women. Ex: If the input is 49 155 148 60, the output is:

Answers

In python:

age = float(input("How old are you? "))

weight = float(input("How much do you weigh? "))

heart_rate = float(input("What's your heart rate? "))

time = float(input("What's the time? "))

print("The calories burned for men is {}, and the calories burned for women is {}.".format(

   ((age * 0.2017) - (weight * 0.09036) + (heart_rate * 0.6309) - 55.0969) * (time / 4.184),

   ((age * 0.074) - (weight * 0.05741) + (heart_rate * 0.4472) - 20.4022) * (time / 4.184)))

This is the program.

When you enter 49 155 148 60, the output is:

The calories burned for men is 489.77724665391963, and the calories burned for women is 580.939531548757.

Round to whatever you desire.

The programming language is not stated. So, I will answer this question using Python programming language.

The program requires a sequence control structure, because it does not make use of conditions and iterations.

The program in python is as follows, where comments (in italics) are used to explain each line.

#This gets input for age, in years

age = int(input("Age (years): "))

#This gets input for weight, in pounds

weight = int(input("Weight (pounds): "))

#This gets input for heart rate, in beats per minutes

heart_rate = int(input("Heart Rate (beats per minutes): "))

#This gets input for time, in minutes

time = int(input("Time (Minutes) : "))

#This calculates the calories burnt for men

Men = ((age * 0.2017) - (weight * 0.09036) + (heart_rate * 0.6309) - 55.0969) * time / 4.184

#This calculates the calories burnt for women

Women = ((age * 0.074) - (weight * 0.05741) + (heart_rate * 0.4472) - 20.4022 ) * time / 4.184

#This prints the calories burnt for men

print("Men:", Men)

#This prints the calories burnt for women

print("Women:", Women)

At the end of the program, the program outputs the amount of calories burnt for men and women.

See attachment for sample run

Read more about Python programs at:

https://brainly.com/question/22841107

Which error produces incorrect results but does not prevent the program from running? a. syntax b. logic c. grammatical d. human e. None of the above

Answers

Answer:

Logic Error

Explanation:

I'll answer the question with the following code segment.

Program to print the smallest of two integers (written in Python)

num1 = int(input("Num 1: "))

num2 = int(input("Num 2: "))

if num1 < num2:

  print(num2)

else:

  print(num1)

The above program contains logic error and instead will display the largest of the two integers

The correct logic is

if num1 < num2:

  print(num1)

else:

  print(num2)

However, the program will run successfully without errors

Such errors are called logic errors

there are no more than 60 people in a certain class to participate in the final .the exam subjects are programming, English, and mathematics .the following functions are realized by two dimensional array programming.calculate the average score of each student

Answers

Answer:

If there are many people in the class and if most of these people have never done such an intensive proof-based class, then I'd say this is not so surprising  that the class average would be 56%-34%

Explanation:

hopes this help this question threw me off a lot

For everyday files that users will use regularly on a user's own Word-compatible computer, the best file format to save as is: o PDF. DOCX ORTE. OTXT.​

Answers

Answer:

DOCX? I think

Explanation:

3.4 Code Practice: Question 1

Answers

Answer:

color = input("What color? ")

if (color == "yellow"):

   print("Correct!")

else:

   print("Nope")

Explanation:

My code is dependent on if the color is supposed to be case sensitive

This assignment requires you to write a well documented Java program to calculate the total and average of three scores, the letter grade, and output the results. Your program must do the following:
Prompt and read the users first and last name
Prompt and read three integer scores
Calculate the total and average
Determine a letter grade based on the following grading scale - 90-100 A; 80-89.99 B; 70-79.99 C; below 70 F
Use the printf method to output the full name, the three scores, the total, average, and the letter grade, properly formatted and on separate lines.
Within the program include a pledge that this program is solely your work and the IDE used to create/test/execute the program. Please submit the source code/.java file to Blackboard. Attached is a quick reference for the printf method.

Answers

Answer:

The solution is given in the explanation section

Don't forget to add the pledge before submitting it. Also, remember to state the IDE which you are familiar with, I have used the intellij IDEA

Follow through the comments for a detailed explanation of each step

Explanation:

/*This is a Java program to calculate the total and average of three scores, the letter grade, and output the results*/

// Importing the Scanner class to receive user input

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   //Make an object of the scaner class

   Scanner in = new Scanner(System.in);

   //Prompt and receive user first and last name;

   System.out.println("Please enter your first name");

   String First_name = in.next();

   System.out.println("Please enter your Last name");

   String Last_name = in.next();

   //Prompt and receive The three integer scores;

   System.out.println("Please enter score for course one");

   int courseOneScore = in.nextInt();

   System.out.println("Please enter score for course two");

   int courseTwoScore = in.nextInt();

   System.out.println("Please enter score for course three");

   int courseThreeScore = in.nextInt();

   //Calculating the total scores and average

   int totalScores = courseOneScore+courseTwoScore+courseThreeScore;

   double averageScore = totalScores/3;

   /*Use if..Else statements to Determine a letter grade based on the following grading scale - 90-100 A; 80-89.99 B; 70-79.99 C; below 70 F */

   char letterGrade;

   if(averageScore>=90){

     letterGrade = 'A';

   }

   else if(averageScore>=80 && averageScore<=89.99){

     letterGrade = 'B';

   }

     else if(averageScore>=70 && averageScore<=79.99){

     letterGrade = 'C';

   }

   else{

     letterGrade ='F';

   }

   //Printing out the required messages

   System.out.printf("Name:  %s %s\n", First_name, Last_name);

   System.out.printf("scores: %d %d %d:  \n", courseOneScore, courseTwoScore, courseThreeScore);

   System.out.printf("Total and Average Score is: %d %.2f:  \n", totalScores, averageScore);

   System.out.printf("Letter Grade: %C:  \n", letterGrade);

  // System.out.printf("Total: %-10.2f:  ", dblTotal);

 }

}

Define a function called sum, for a given an array and an int representing its size, if the size is at least 3, then sum up all elements whose indices are a multiple of 3 and return that value, otherwise, return 0.

Answers

Answer:

Written in C++

int sum(int arr[], int size) {

 int total = 0;      

 if(size>=3)  {

  for (int i = 0; i < size; ++i) {

     if(i%3 == 0)      {

     total += arr[i];    

     }

  }

 }

  return total;

}

Explanation:

This line defines the function

int sum(int arr[], int size) {

This line initializes sum to 0

 int total = 0;      

This line checks if size is at least 3

 if(size>=3)  {

This loop iterates through the array

  for (int i = 0; i < size; ++i) {

The following adds multiples of 3

     if(i%3 == 0)      {

     total += arr[i];    

     }

  }

 }

This returns the calculated sum

  return total;

}

See attachment for full program

CJ is developing a new website blogging about cutting-edge technologies for people with special needs. He wants to make the site accessible and user friendly.
CJ knows that some of the visitors who frequent his website will use screen readers. To allow these users to bypass the navigation, he will use a skip link, He wants to position the skip link on the right but first he must use the ____ property.
a) display
b) right
c) left
d) nav

Answers

Answer:

The answer is "Option c".

Explanation:

It is an internal page reference which, whilst also completely new pages, allow navigating around the current page. They are largely used only for bypassing and 'skipping' across redundant web page content by voice command users, that's why the CJ would use a skip link to enable those users to bypass specific navigation, and he also wants to put this link on the right, but first, he needs to use the left property.

what is the use of buffer?​

Answers

Answer:

pH buffer or hydrogen ion buffer) is an aqueous solution consisting of a mixture of a weak acid and its conjugate base, or vice versa. ... Buffer solutions are used as a means of keeping pH at a nearly constant value in a wide variety of chemical applications.

Explanation:

there is your answer i got this one correct

hope it is helpful

Answer:

Limits the pH of a solution

Explanation:

A P  E X

Write a program that takes a three digit number (input) and prints its ones, tens and hundreds digits on separate lines

Answers

In python:

number = input("Enter your number ")

i = 0

while i < len(number):

   print(number[i])

   i += 1

I don‘t know how to solve a crossword puzzle. Please help me!!!

Answers

Across would be words like: HELLO.
Vertically would be words like: H

E
Y

Documents files should be saved as a _____ file

Answers

Answer:

PDF

Explanation:

Write a recursive function that prints out the items of a (possibly empty) singly linked list of integers in reverse order. The function should run in linear time.

Answers

Answer:

Follows are the method definition to this question:

void Reverse_Order(struct Node* h)//defining a recursive method Reverse_Order that takes structure in parameter

{

if (h == NULL)//use if block to check head equal to null

return;//use return keyword

Reverse_Order(h->next);//call method recursively

cout<<h->data;//print data

}

Explanation:

In the above code, a recursive method "Reverse_Order" takes structure as the parameter, and inside the method, structure variable h is used that uses the if conditional statement to check the header equal to null.

In the condition is true, it will use the return keyword, and in the next step, it calls the method recursively, and print its value in the reverse order.


Describe how to manage the workspace by putting each feature under the action it helps carry out

Answers

Answer:

Viewing Documents one at a time:Windows+tab keys,

Windows taskbar

Viewing documents at same time:

Snap,Arrange all

Explanation:

 The workspace can be managed by putting control of the surroundings it's far important that you examine all of the factors and items found in your area.

What is the workplace for?

Workspaces had been round in Ubuntu properly earlier than the transfer to Unity. They essentially offer you a manner to organization home windows associated with comparable duties together, in addition to get "additional" screenspace.

The subsequent step is to outline a logical and optimizing feature for the factors with a view to continuing to be on your surroundings, defining that each of them may be capable of carrying out an easy and applicable project for his or her paintings.

Read more about the workspace :

https://brainly.com/question/26463698

#SPJ2

(d) Assume charArray is a character array with 20 elements stored in memory and its starting memory address is in $t5. What is the memory address for element charArray[5]?

Answers

Answer:

$t5 + 5

Explanation:

Given that ;

A character array defines as :

charArray

Number of elements in charArray = 20

Starting memory address is in $t5

The memory address for element charArray[5]

Memory address for charArray[5] will be :

Starting memory address + 5 :

$t5 + 5

Choose the word to make the sentence true. The ____ function is used to display the program's output.

O input
O output
O display

Answers

The output function is used to display the program's output.

Explanation:

As far as I know this must be the answer. As tge output devices such as Monitor and Speaker displays the output processed.

The display function is used to display the program's output. The correct option is C.

What is display function?

Display Function Usage displays a list of function identifiers. It can also be used to display detailed usage information about a specific function, such as a list of user profiles with the function's specific usage information.

The displayed values include the prefix, measuring unit, and required decimal places.

Push buttons can be used to select functions such as summation, minimum and maximum value output, and tare. A variety of user inputs are available.

A display is a device that displays visual information. The primary goal of any display technology is to make information sharing easier. The display function is used to display the output of the program.

Thus, the correct option is C.

For more details regarding display function, visit:

https://brainly.com/question/29216888

#SPJ5

Which of the following documents has a template available in the online templates for your use?
letters
resumés
reports
all of the above

Answers

Answer:

The answer is all of the above.

Explanation:

Which of the following is true about strings?
They cannot be stored to a variable
An input (unless otherwise specified) will be stored as a string
They do not let the user type in letters, numbers and words
They are used for arithmetic calculations

Answers

Answer:

Your answer is option C, or the third option.

They do not let the user type in letters, numbers, and words.

Explanation:

Strings are defined as a sequence of characters literal, constant, or variable. These sequences are like an array of data or list of code that represents a structure. Formally in a language, this includes a finite(limited) set of symbols derived from an alphabet. These characters are generallu given a maximum of one byte of data each character. In longer languages like japanese, chinese, or korean, they exceed the 256 character limit of an 8 bit byte per character encoding because of the complexity of the logogram(character representing a morpheme((which is the simpliest morphological(form or structure) unit of language with meaning)) character with 8 bit (1 byte, these are units of data) refers to cpu(central processing unit) which is the main part of a computer that processes instructions, and sends signals.

The reading element punctuation relates to the ability to

pause or stop while reading.

emphasize important words.

read quickly yet accurately.

understand word definitions.

Answers

Answer:

A

Explanation:

Punctations are a pause or halt in sentences. the first one is the answer so do not mind the explanation.

semi colons, colons, periods, exclamation points, and question Mark's halt the sentence

most commas act as a pause

Answer: (A) pause or stop while reading.

Explanation:

Is 583 a string or a number?

Answers

It is a number that is the answer

Answer:

a string

answer

Two of the computers at work suddenly can’t go online or print over the network. The computers may be trying to share the same IP address.

Which strategy is most likely to solve the problem?
rebooting the network server
reconfiguring the network hubs
installing network gateway hardware
logging off one of the computers, and then logging back o

Answers

Answer:

logging off one of the computers, and then logging back on

Answer:

the last one:

logging off one of the computers, and then logging back on

Explanation:

if something goes wrong on an electronic device you can reboot it and it should eventually work.

have a nice day

PV = 11,000 AC = 6000 CV = 4,000. What is SV? What does this calculation tell you?

Answers

Answer:

I don't see an SV in the examples.. I suspect these are the name plate numbers off of a transformer... but.. more context would really help

Explanation:

List three hardware computer components? Describe each component, and what its function is.

Answers

Answer:

moniter: a screen and is used to see what the computer is running

webcam: the camera on the computer. can be already built in or added

power supply: an electrical device that supplies power to an electrical load

Explanation:

Answer:

Input device

output device

C.P.U

Shortest Remaining Time First is the best preemptive scheduling algorithm that can be implemented in an Operating System.

a. True
b. False

Answers

Answer:

a

Explanation:

Yes, true.

Shortest Remaining Time First, also popularly referred to by the acronym SRTF, is a type of scheduling algorithm, used in operating systems. Other times it's not called by its name nor its acronym, it is called the preemptive version of SJF scheduling algorithm. The SJF scheduling algorithm is another type of scheduling algorithm.

The Shortest Remaining Time First has been touted by many to be faster than the SJF

The answer to the question which asks if the Shortest Remaining Time First is the best preemptive scheduling algorithm that can be implemented in an Operating System is:

True

What is Shortest Remaining Time First?

This refers to the type of scheduling algorithm which is used to schedule tasks that would be executed in the processing unit in an Operating System based on the shortest time taken to execute the task.

With this in mind, we can see that this is the best preemptive scheduling algorithm that can be implemented in an Operating System because it makes task execution faster.

Read more about scheduling algorithm here:
https://brainly.com/question/15191620

The best method to prevent information on a disk from being discovered is to: A) use DOD overwrite protocols in wiping information from the disk. B) put the disk and the computer under water. C) melt the plastic disk contained within a hard drive container. D) smash the drive with a stout hammer

Answers

Answer:

C) Melt the plastic disk contained within a hard drive container

Explanation:

Data protection is very necessary from keep saving information from those that are not eligible to access it. It helps to avoid phishing scams, and identity theft.Alot of information are stored on the harddisk daily which can be read by disk drive, as situation can warrant prevention of third party from discovering information on it.There is hard platter used in holding magnetic medium in hard disk which make it different from flexible plastic film used in tapes.The disk drive container helps to hold as well power the disk drive.

It should be noted that The best method to prevent information on a disk from being discovered is to firstly

Melt the plastic disk contained within a hard drive container.

Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call of min(3, -2, 7) would return -2, and a call of min(19, 27, 6) would return 6. Use Math.min to write your solution.

Answers

Answer:

public class Main

{

public static void main(String[] args) {

 System.out.println(min(3, -2, 7));

}

public static int min(int n1, int n2, int n3){

    int smallest = Math.min(Math.min(n1, n2), n3);

    return smallest;

}

}

Explanation:

*The code is in Java.

Create a method named min that takes three parameters, n1, n2, and n3

Inside the method:

Call the method Math.min() to find the smallest among n1 and n2. Then, pass the result of this method to Math.min() again with n3 to find the min among three of them and return it. Note that Math.min() returns the smallest number among two parameters.

In the main:

Call the method with parameters given in the example and print the result

Methods are named program statements that are executed when called/invoked.

The method in Python, where comments are used to explain each line is as follows:

#This defines the method

def mmin(a,b,c):

   #This calculates the smallest of the three values using math.min

   minNum = min(a,b,c)

   #This prints the smallest value

   return minNum

Read more about methods at:

https://brainly.com/question/14284563

To create a public key signature, you would use the ______ key.

Answers

Answer:

To create a public key signature, you would use the _private_ key.

Explanation:

To create a public key signature, a  private key is essential to enable authorization.

A private key uses one key to make data unreadable by intruders and for the data to be accessed the same key would be needed to do so.

The login details and some important credentials to access user data contains both the user's public key data and private key data. Both private key and public key are two keys that work together to accomplish security goals.

The public key uses different keys to make data readable and unreadable.

The public key is important to verify authorization to access encrypted data by making sure the access authorization came from someone who has the private key. In other words, it's a system put in place to cross-check the holder of the private key by providing the public key of the encrypted data that needed to be accessed. Though, it depends on the key used to encrypt the data as data encrypted with a public key would require a private key for the data to be readable.

Is main memory fast or slow?

Answers

Answer:

Slower

Explanation:

Write a program that asks for the names of three runners and the time, in minutes, it took each of them to finish a race. The program should display the names of the runners in the order that they finished.

Answers

Answer:

Written in Python

names = []

times = []

for i in range(0,3):

     nname = input("Name "+str(i+1)+": ")

     names.append(nname)

     time = input("Time "+str(i+1)+": ")

     times.append(time)

if times[2]>=times[1] and times[2]>=times[0]:

     print(names[2]+" "+times[2])

     if times[1]>=times[0]:

           print(names[1]+" "+times[1])

           print(names[0]+" "+times[0])

   else:

           print(names[0]+" "+times[0])

           print(names[1]+" "+times[1])

elif times[1]>=times[2] and times[1]>=times[0]:

     print(names[1]+" "+times[1])

     if times[2]>times[0]:

           print(names[2]+" "+times[2])

           print(names[0]+" "+times[0])

     else:

           print(names[0]+" "+times[0])

           print(names[2]+" "+times[2])

else:

     print(names[0]+" "+times[0])

     if times[2]>times[0]:

           print(names[2]+" "+times[2])

           print(names[1]+" "+times[1])

     else:

           print(names[1]+" "+times[1])

           print(names[2]+" "+times[2])

Explanation:

I've added the full source code as an attachment where I used comments to explain difficult lines

Which of the following tasks can you perform using a word processor?
insert a bulleted list in a document
check a document for spelling errors
edit a video for inclusion in a document
create an outline of sections to be included in a document
set a password to restrict access to a document

Answers

Create a outline of sections to be included in a document

The following task can you perform using a word processor is creating an outline of sections to be included in a document. The correct option is c.

What is a word processor?

A word processor is a computer program or device that provides for input, editing, formatting, and output of text, often with additional features.

Simply put, the probability is the likelihood that something will occur. When we don't know how an event will turn out, we can discuss the likelihood or likelihood of several outcomes.

Statistics is the study of events that follow a probability distribution. In uniform probability distributions, the chances of each potential result occurring or not occurring are equal.

Therefore, the correct option is c. create an outline of sections to be included in a document.

To learn more about word processors, refer to the link:

https://brainly.com/question/14103516

#SPJ5

Other Questions
A student is working two jobs over the summer to pay for a new car. The student gets paid $25 for each lawn thatis mowed ( 2 )and $15 for each pool that is cleaned (y). The student wants to earn $750 to pay for a down paymenton a car.What is the y-intercept slope of (-4,7) (-6,-4) A builder bought 47 1/2 acres of land and divided it into lots of 2 1/2 acres each. How many lots werethere? What ways have you observed a particular group of people or community being underserved or wronged? NowSelecBITodaOOOOOOHow and why do ionic bonds form? Check all of the boxes that applylonic bonds form between metal atoms and other metal atoms.Ionic bonds form between metal atoms and nonmetal atomsThe more electronegative atoms transfer one or more electrons to the less electronegative atomThe less electronegative atoms transfers one or more electrons to the more electronegative atom,The metal atom forms a cation and the nonmetal atom forms an anionThe attraction between ions with the same charge forms an ionic bond,The attraction between ions with an opposite charge forms an ionic bond.BLOI loDONEEloYous how you have a seizure? Le Morte D'arthur Perfect Paragraph Assignment In Thomas Mallory's Morte D'arthur, Arthur is killed after battling his son Modred despite being warned against this by Sir Gawain in a dream. Using evidence from the text, explain the main events that led to Arthur's death, as well as how it could have been prevented if possible) Please color code your paragraph (see chart below) and submit in Google Classroom when you finish please help me 3(4x - 2) > 7x + 19 Josiah downloads 44 songs, including 16 songs by his favorite band. what is most delicious fod in the philippines? Which type of cloud is incorrectly paired with its shape? A. Cirrus: wispy, feathery B. Cumulus: narrow, smoky C. Cumulonimbus: towering with a flat top D. Stratus: flat layers Before the French and Indian War, Spain had controlled Florida forunder fifty years.over five hundred years.over two hundred years.under twenty years. consider an iron cube and an aluminun cube. If the two cubes were at the same temperature, how would the average kinetic energy of the particles in iron compare with the average kinetic energy of the particles in aluminun Which of the following is an example of a fiat? *9 pointsa kings decree that nobody may criticize hima childs request for a second helping at dinnera customers demand for a refund for a defective producta managers recommendation that the department be reorganized In one month, Jillian made 36 local phone calls and 20 long distance calls.What was her ratio of local calls to long distance calls for that month?A. 2:1B. 3:2C. 9:4D. 9:5 if there are 10 people per race, and 2222 people have come in first place, then how many races have happened? what is 1/2 / 1/4. Please help am getting two answers.idk the correct one. Which of the following describes the mass of an object precisely ? *2.34 kg2.345 kg 2 kg2.3 kg How were marriage alliances used to strengthen the Chickasaw? Choose three correct answers. They helped create peace. They helped expand their territory. They kept trade networks open. They protected them from rival tribes. They forged a bond with Europeans. Review why carbon can form a variety of organic compounds in a variety of shapes.