Write a program that computes the sum of squares for a sequence of positive whole numbers. The program asks the user to enter the starting number. Then it asks the user to enter an ending number. It computes the square for each number from the starting number to the ending number. It also calculates the sum of these squares. It displays the numbers, their squares and the sum of the squares.

Answers

Answer 1

Answer:

In Python:

start = int(input("Start: "))

end = int(input("End: "))

total = 0

print("Number\t Squares")

for num in range(start,end+1):

   print(num,"\t",num**2)

   total+=num**2

print("Total: ",total)

Explanation:

This gets the starting number

start = int(input("Start: "))

This gets the ending number

end = int(input("End: "))

This initializes total to 0

total = 0

This prints the header

print("Number\t Squares")

This iterates through start to end

for num in range(start,end+1):

This prints each number and its square

   print(num,"\t",num**2)

This calculates the total squares

   total+=num**2

This prints the calculated total

print("Total: ",total)


Related Questions

"Wake up to reality! Nothing ever goes as planned in this world. The longer you live, the more you realize that in this reality only pain, suffering and futility exist.
Where is this quote from

Answers

Answer:

Naruto Shippuden and from madara uchiha

Explanation:

Answer:

Madara to Obito in Naruto Shippuden after Obito regains conscious from passing out under the rock from the third graet ninja war

Explanation:

Can someone plz answer these questions plz

Answers

Answer:

ñbyte I'm pretty sure, sorry if u get it wrong you should do more research about the question if i get it wrong!!

5) Write a program to read text to end-of-file, and print a count of word lengths, i.e. the total number of words of length 1 which occurred, the number of length 2, and so on. Define a word to be a sequence of alphabetic characters. You should allow for word lengths up to 25 letters. A typical output should be like this: length 1 : 10 occurrences length 2 : 19 occurrences length 3 : 127 occurrences length 4 : 0 occurrences length 5 : 18 occurrences

Answers

Answer:

Explanation:

The following code is written in Python. It is a function that takes in the name of the file to be read and the size of the word. Then the function reads the file, removes whitespace and commas, splits the text into words, and scans the words for all the words that have the same length as the number passed. It counts all those words and prints out the number of occurrences of words of that length.

def countOccurrences(file_name, word_size):

   f = open(file_name, 'r')

   text = f.read()

   text = text.replace(',', '')

   split_text = text.split(' ')

   occurrences = 0

   for word in split_text:

       if len(word) == word_size:

           occurrences += 1

   print("Length 1: " + str(occurrences) + " occurrences")

In python please!!! Write the definition of a function named countPos that reads integer values from standard input until there are none left and returns the number that are positive. The function must not use a loop of any kind.

Answers

Answer:Here is the method countPos    

 static int countPos(Scanner input){ //method that takes a reference to a Scanner object

  int counter=0;  // to count the positive integers  

  int number; //to store each integer value

  if(input.hasNextInt()){ //checks if next token in this scanner input is an integer value

      number=input.nextInt(); //nextInt() method of a Scanner object reads in a string of digits and converts them into an int type and stores it into number variable

      counter=countPos(input); //calls method by passing the Scanner object and stores it in counter variable

      if(number>0) //if the value is a positive number

          counter++;    } //adds 1 to the counter variable each time a positive input value is enountered

  else    { //if value is not a positive integer

      return counter;    } //returns the value of counter

  return counter; } //returns the total count of the positive numbers

Explanation:

Here is the complete program:

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

public class Main { //class name

//comments with each line of method below are given in Answer section

static int countPos(Scanner input){

  int counter=0;

  int number;

  if(input.hasNextInt()){

      number=input.nextInt();

      counter=countPos(input);

      if(number>0)

          counter++;    }

  else    {

      return counter;    }

  return counter; }

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

      System.out.println("Number of positive integers: " + countPos(new Scanner(System.in)));  } } //prints the number of positive integers by calling countPos method and passing Scanner object to it

The program uses hasNextInt method that returns the next token (next input value) and if condition checks using this method if the input value is an integer. nextInt() keeps scanning the next token of the input as an integer. If the input number is a positive number then the counter variable is incremented to 1 otherwise not. If the use enters anything other than an integer value then the program stops and returns the total number of positive integers input by the user. This technique is used in order to avoid using any loop. The program and its output is attached

Explanation:

All of the following are problem-solving steps except:
A. taking action.
B. defining the problem.
c. doing the first solution that comes to mind.
D. creating possible solutions.

Answers

Answer:

C. Doing the first solution that comes to mind.

Explanation:

Lets break this down a bit.

A is a great problem solving step, so we can mark that off.

We can do the same for B.

However, for C, I am hesitant about this one, so I wont mark it off quite yet.

Finally, for D, it is definitely a step, so I can mark that off.

You should never do the first solution that comes to mind, since you haven't done enough brainstorming about other ideas.

Hope this helps!

A digital footprint is .

Answers

Your digital footprint is the trail of 'electronic breadcrumbs' you leave behind when you use the internet. It can include the websites you visit, the photos you upload and your interactions with other people on social networks.

Answer: is something you must manage

⚠️⚠️⚠️⚠️HELP - What is the software that allocates resources of a physical computer to a virtual machine?
Group of answer choices

Switch

Operating systems

Hypervisor

HostVM

Answers

Answer:

the answer is going to be hostvm

HELP PLZZZZZZZZ!!!!!!!!!!!

Type the correct answer in the box. Spell all words correctly.
Before a new email application could be released to the public, it was released for a few days to some account holders of a website. The project team then collected feedback from this limited number of users and later made the email application available for public use. What type of testing did the project team use?
The project team used_____________testing for the email application.

Answers

Answer:

Its either business format franchise or business brokers

Consider the following relation with functional dependencies as shown below.R{sno,sname,age,cno,cname,group}
R(A,B,C,D,E,F)
A-B,C
C-F
D-E
which normal form is the relation R is in?

Answers

Answer:

First Normal Form

Explanation:

The correct answer is - First Normal Form

Reason -

Given that,

A-B,C

C-F

D-E

Here the key is AD

The two partial Functional dependencies are -

A-B,C  

D-E

So,

They are not in Second Normal Form, but they are in First Normal Form.

Justify any FOUR significant factors to remember when installing your motherboard

Answers

Answer:

The answer is below

Explanation:

When a computer system is being assembled by individuals or to provide a repair. There are factors to remember when installing your motherboard. Some of them include:

1. RAM (Random Acess Memory) support: Ensure the RAM of the PC supports the motherboard capacity.

2. Main Use of the PC: The motherboard to be installed on a PC should be based on the regular usage of the PC.

3. Compatibility with the operating system of the PC is essential. This will allow you to check if it will work well with PC without a glitch

4. Cost of the motherboard: it is advisable to go for a motherboard that can deliver value even if it is somehow expensive.

The number of P/E cycles that a solid-state drive can support may vary, within what range?
o
1 to 100
1,000 to 100,000
10,000 to 10 million
10 billion to 10 trillion

Answers

Answer:

C. 10,000 To 10 Million

Explanation:

Got It Right On Edge

Answer:

the answer is C. 10,000 to 10 million

Explanation:

i took the test on edge

Aspire is a test you take to prepare for the
A. PSAT
B. SAT
C. ACT
D. FAFSA

Answers

Answer:

ACT

Explanation:

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing." - https://greentestprep.com/resources/act-prep/act-aspire-test/

Aspire is a test you take to prepare for the ACT. Thus, option C is correct.

What is ACT?

"ACT Aspire is a powerful tool to help students and their parents monitor progress toward a successful ACT test from third grade through tenth grade. The Aspire test assess students' readiness in five areas covered by the ACT test: English, math, reading, science and writing.Aspire is a test people take as a preparation for both ACT a d SAT.

Aspire is a valuable tool to help students and their parents monitor progress towards a good ACT exam from 3rd to 10th grade. The Aspire test assesses student performance in five areas covered by the ACT exam: English, math, reading, science and writing. Aspire Test is offered in the spring and fall seasons, the cost of the assessment tool depends on how many subjects you would like to measure and how often you want your student to be tested.

Learn more about Aspire Test on:

https://brainly.com/question/4469429

#SPJ7

Create a program that: Provides access to a rolodex (list of names and contact information). Have the program accept a name to lookup and that prints the contact information of the matching name. Use an array for names and an array for email address and another array for phone numbers. Make sure that all three arrays contain corresponding information.

Answers

Answer:

Explanation:

The following code is written in Java, it asks the user for a name and looks that name up in the names array. If it finds it prints out all the values in that same index within every array to get the name, email, and phone number. If the name is not found it prints out that the client is not found.

//The code is attached in the text file below and picture shows the output of the working code.

Edna needs a safer car to drive. She likes to travel a lot, so she is looking for a small SUV. She is trying to decide between buying a new or used car. After doing some research, she finds out that most cars lose value each year by a process known as depreciation. You may have heard before that a new car loses a large part of its value in the first 2 or 3 years and continues to lose its value, but more gradually, over time. That is because the car does not lose the same amount of value each year, but it loses approximately the same percentage of its value each year. What kind of model would be most useful for calculating the value of a car over time?

Answers

Answer: Buy a new car

Explanation: If its a used car its breaks will be worn out and more likely the breaks will stop working in 6 months and you have to change them. May the forse be with you.

which of the following is an example of bias in media?
A. a website that represents a controversial opinion as though it were fact
B. a television news program that presents both sides of a particular issue
C. a podcast expressing an authors opinion
D. a blog about the history of the civil war

Answers

Answer is A because stating a opinion as a fact is bias.

a website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

What is Website?

A website is a group of interconnected, publicly accessible Web pages with a common domain name. A website can be developed and maintained to serve a variety of objectives by an individual, group, company, or organization.

The World Wide Web is made up of all websites that are open to the public.

Although it is occasionally referred to as a "web page," this description is incorrect because a website is made up of multiple webpages. A "web presence" or simply "site" are other names for websites.

Therefore, A website that represents a controversial opinion as though it were fact because stating a opinion as a fact is bias.

To learn more about Website , refer to the link:

https://brainly.com/question/29777063

#SPJ2

Which option is used to determine whether information that should remain private is included in the final version of a PowerPoint presentation?
Compatibility Check
Grammar Checker
Document Inspector dialog box
Trust Center

Answers

Answer:

Im pretty sure you should put a document inspector dialog box

Answer:

Document Inspector dialog box

Explanation:

edge 2022

What are the two main parts of system unit hardware?

Answers

Answer: Computers have two main parts: hardware and software

Like piano (hardware) and music (software)

Explanation:

PLS HELP WILL MARK BRAINLINESS AND 30 POINTS
In your own words in at least two paragraphs, explain why it is important, when developing a website, to create a sitemap and wireframe. Explain which process seems most important to you and why you feel most drawn to that process.

(i.e. paragraph one is why is it important and paragraph two is which process felt most important to you and why)

Answers

When creating a website, it is important to create a sitemap so that a search engine can find, crawl and index all of your website's content. a sitemap makes site creation much more efficient and simple. A sitemap also helps site developers (assuming you have any) understand the layout of your website, so that they can design according to your needs.

A wireframe is another important step in the web design process. Creating a website is like building a house. To build the house, you first need a foundation on which to build it upon. Without that foundation, the house will collapse. The same goes for a website. If you create a wireframe as a rough draft of your website before going through and adding final touches, the entire design process will become much easier. If you do not first create a wireframe, the design process will be considerably more difficult, and you are more likely to encounter problems later on.

To me, the wireframe is the most important due to the fact that is necessary in order to create a good website. In order to create a sitemap, you first need a rough outline of your website. Without that outline, creating a sitemap is impossible.

. What is piracy? ???????????????????​

Answers

Answer: a practice similar to piracy but in other contexts, especially hijacking.

"air piracy"

the unauthorized use or reproduction of another's work.

Explanation:

The aim of this activity is to implement an algorithm that returns the union of elements in a collection. Although working with sets is quick and easy in Python, sometimes we might want to find the union between two lists. Create a function called unite_lists, which uses a loop to go through both lists and return common elements. Do not use the built-in set function.

Answers

Answer:

The function in Python is as follows:

def unite_lists(A, B):

   union = []

   for elem in A:

       if elem in B:

           union.append(elem)

   return union

Explanation:

This defines the function

def unite_lists(A, B):

This initializes an empty list for the union list

   union = []

This iterates through list A

   for elem in A:

This checks if the item in list A is in list B

       if elem in B:

If it is present, the item is appended to the union list

           union.append(elem)

This returns the union of the two lists

   return union

HELPPPPPP How is does technology impact the career of your choice? Write 5-6 sentences about how technology impacts the career of your choice.

Answers

Answer:

Explanation:

Summary. Technology has had a dramatic impact on the nature of work itself, individual applicants and employees, employers, and career counselors. It has changed the nature of work and the types of jobs that people do today. It has altered the knowledge and skills individuals need to be effective workers.

PLZZZ HELP
Select the correct answer.
Ed is the manager of a software design team. He needs to call a design review meeting. Who should he call for this meeting?
A.
only the stakeholders and external reviewer
B.
stakeholders and technical team
C.
the technical team and external reviewer
D.
only the technical team
E.
only the external reviewer and stakeholders

Answers

I think the answer is C

Answer:

C: the technical team and external reviewer

Explanation:

Plato/Edmentum

to be useful for most household applications, DC voltage is?please

Answers

Answer: To be useful for most household applications, DC voltage is passed through a step-down transformer.

Explanation: Voltage coming through AC or DC outlets is typically far too high for most household appliances to handle, so the current is passed through a step-down transformer to reduce the voltage to a usable level.

Is this correct? I say its B, but my friend says its D.

Answers

The answer is B, best of luck!

Evaluate the following information that shows the projected change in employment from 2014-2024: How can job seekers use the chart? Add data to a résumé and cover letter Gain awareness of how growth trends can impact career plans Research which careers match current skills Talk to community members in a knowledgeable manner You must check the box below prior to submitting your exam! Check this box to indicate you are ready to submit your exam Submit Exam FDK191.10

Answers

Answer:

Answer is B.

Gain awareness of how growth trends can impact career plans

Explanation:

who was the first inventor of computer​

Answers

Answer:

Explanation:

English mathematician and inventor Charles Babbage is credited with having conceived the first automatic digital computer. During the mid-1830s Babbage developed plans for the Analytical Engine.

Answer:

Charles Babage is the first inventor of computer.

PLZZZ HELP
Select the correct answer.
A company utilizes a specific design methodology in the software design process. They utilize concepts of encapsulation in design. Which design methodology would they be using?
A.
structured design
B.
modular design
C.
object-oriented design
D.
rapid application development
E.
use-case design

Answers

Answer:

C is object-oriented design

A financially stable person is able to:
A. spend money without having to save.
B. use loans to cover his or her living costs.
C. default on loan payments.
D. save money.

Answers

I think D. To save money cuz thats how financially stable people stay financially stable

Answer:

Save Money

Explanation:

D

PLZZ HELP!!!
Select the correct text in the passage.
Dan is working with a team that is integrating an application with a database system. Which of these statements are true with regard to database systems?

1.The testing phase of the SDLC creates databases.
2.Selection of a DBMS occurs during the designing phase of the SDLC.
3.Database development also has a life cycle, with phases similar to those of the SDLC.
4.All compilers intrinsically support database creation.
5.Databases use query language to perform operations.

Answers

Answer:

I don't know

Explanation:

with data you can access all things in the world

PLZZZ HELP!!!
Select the correct answer.
A testing team has a new software application to test. While writing the test plan, the team enters some functions that are out of scope for the current phase of testing. In which section of the test plan will you find these functions?
A.
Introduction
B.
Features not to Test
C.
Deliverables
D.
Dependencies

Answers

Answer:

D the answer is D or c one of those 2

Other Questions
Bacteria are only able to be produced from other bacteria already existing on earth. Which theory best describes this? Help me I have this due today!!! How did the Savannah River play an enormous role in the creation of the colony of Georgia Tai has a bag of different-colored balloons. Without looking in the bag, she selects a balloon, records its color, and puts it back in the bag. All balloons are equally likely to be chosen. She performs 50 trials.Number of times a red balloon was chosen 15 Number of times a yellow balloon was chosen18 Number of times a green balloon was chosen9 Number of times a pink balloon was chosen8 Based on the data Tai collected, what is the estimated probability, in simplest form, of choosing a yellow balloon from the bag?A. 9/50B. 18/100C. 9/25D. 50/18 the circumference of a circle is 62 TT cm. the area of the circle is ___ TT cm^2. PLEASE HELP THIS IS DUE IN 10 MIN Caption this Irene and Francisco have decided to go visit relatives in Ponce. They have gotten together to discuss what they are going to do. Describe their plans, using at least six words from the list.caro/a,dinero,divertirse,maleta,pasaje,rebaja,regalo,relajarse,ropa,salir The name "Black Shirts" was given to supporters ofA. Joseph StalinB. Benito MussoliniC. Adolf HitlerD. Victor Emmanuel III Introduction: Sort the tasks according to which presidential role they fall under In an energy pyramid, the bottom level represents...A. consumersB. producersC. scavengersD. decomposers Answer please and explain HELPPPP ITS TIMEDDD WILL GIVE BRAINLYISTTTT Which statement best compares the two types of trialcourts?O Superior courts are located in only a few districts;state courts are across Georgia.O Superior court judges are appointed, and state courtjudges are elected.O Superior courts oversee criminal cases, and statecourts oversee civil cases.Superior courts handle all kinds of trials; statecourts handle misdemeanors and some civil trials. Which are Southeast Asian states?ChampaBayonVishnuAngkorDai VietMing Pat is narrating a story in ASL. How can he indicate that the story has come to an end? Assume Cluck Home Remedy reported the following adjusted account balances at year-end. 2019 2018 Accounts Receivable $ 1,730,200 $ 1,380,920 Allowance for Doubtful Accounts (96,000 ) (79,900 ) Accounts Receivable, Net $ 1,634,200 $ 1,301,020 Assume the company recorded no write-offs or recoveries during 2019. What was the amount of Bad Debt Expense reported in 2019 What was one major problem the United States faced at the close of the CivilWar? Por qu losnios debenaprender filosofar? In Phoenix, Arizona, the average temperature is 85 degrees Fahrenheit or higher during 25% of the year. During about how many weeks of the year is the average temperature below 85 degrees Fahrenheit? Two angles form a linear pair. The measure of one angle is eighttimes greater than the measure of the other angle. Find the measureof the bigger angle only.