1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
grandymaker [24]
3 years ago
11

Program 4: But I haven’t taken Calculus yet! OK – we admit, this one might look nasty, but read on because it’s not that bad. On

e of the things that computing folks do A LOT (especially CS students) is analyze how long a program takes to run. In the first step, something might take 1 unit of CPU time. The second step might take 2, the third 3 and so on. Mathematically, that would be expressed by the "summation" operator as this: ∑???? ???? ????=1 This is may look complex, but all it’s saying is that i goes from 1 to n and you sum all those numbers together. So, if (n = 10), ∑???? ???? ????=1 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 Fortunately, this reduces to a simple formula. When summing numbers from 1-n, the sum is: (n+1)*n/2 Why? It’s all in how you "pair" the numbers together. In the example above, we could pair (1+10) =11, (2+9)=11, (3+8)=11 and so on. That is, we have n/2 "pairs" of (n+1). Your task is, without using a loop (which we haven’t covered yet), to write a program that asks the user for a number, then prints out the sum of 1 to that number. If you use a loop, you will receive no credit
Computers and Technology
1 answer:
34kurt3 years ago
5 0

Answer:

wdadawdawdawdawdawdawdawsdwfawf

Explanation:

Program 4: But I haven’t taken Calculus yet! OK – we admit, this one might look nasty, but read on because it’s not that bad. One of the things that computing folks do A LOT (especially CS students) is analyze how long a program takes to run. In the first step, something might take 1 unit of CPU time. The second step might take 2, the third 3 and so on. Mathematically, that would be expressed by the "summation" operator as this: ∑???? ???? ????=1 This is may look complex, but all it’s saying is that i goes from 1 to n and you sum all those numbers together. So, if (n = 10), ∑???? ???? ????=1 = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55 Fortunately, this reduces to a simple formula. When summing numbers from 1-n, the sum is: (n+1)*n/2 Why? It’s all in how you "pair" the numbers together. In the example above, we could pair (1+10) =11, (2+9)=11, (3+8)=11 and so on. That is, we have n/2 "pairs" of (n+1). Your task is, without using a loop (which we haven’t covered yet), to write a program that asks the user for a number, then prints out the sum of 1 to that number. If you use a loop, you will receive no credit

You might be interested in
What are input masks most useful for in data validation? moving data from one field to another hiding parts of a value that are
tia_tia [17]

Answer:

Ensuring Consistent Formatting of Values in a Specific Field

Explanation:

6 0
3 years ago
Read 2 more answers
You are the IT security administrator for a small corporate network. The HR director is concerned that an employee is doing some
sp2606 [1]

Answer: A, it's the most professional way or C but I'd choose A

7 0
2 years ago
Suggest names for a coding club
bulgar [2K]

Answer:

  • <u>Abstract Connoisseurs.</u>
  • <u>Hypertext Assassins.</u>
  • <u>Callback Cats.</u>
  • <u>Boolean Autocrats.</u>
  • <u>Runtime Terror.</u>

Explanation:

<em><u>Hope it's help you !!</u></em>

3 0
3 years ago
Course Aggregation Many times, departments are only interested with how students have done in courses relative to a specific maj
nadezda [96]

Answer:

def course_grader(student_to_grades, course_prefix):

   student_grades = dict()

   for key, value in student_to_grades.items():

       grade_score = 0

       for course,grade in value.items():  

           if course_prefix == course:  

               grade_score += grade

                student_grades[key] = grade_score / len(value.keys())

   return student_grades

Explanation:

The course_grader function is a python program that accepts two arguments, the student dictionary and the course prefix. The function returns a dictionary of the student id as the key and the average grade of the student as the value.

8 0
3 years ago
Can you shoot video on the Olympus E-410?
Masja [62]
Yes you must update or do something first but then you can
6 0
3 years ago
Read 2 more answers
Other questions:
  • Your dad just purchased a new desktop with Windows 8 Professional. He is calling you, informing you that he is unable to remote
    9·1 answer
  • Ad designers use movement in order to
    9·2 answers
  • Cloud resources are​ ________ because many different organizations use the same physical hardware.
    12·1 answer
  • 18) choose which article title would most likely be described by the database subject headings victims of famine, ireland, histo
    14·1 answer
  • How would you define data science ?
    10·1 answer
  • A store owner keeps a record of daily transactions in a text file. Each line contains three items: The invoice number, the cash
    7·1 answer
  • List all the components of a computer
    14·2 answers
  • Look at the picture ​
    13·2 answers
  • Question 3 of 10<br> What was the fly in the ointment of Timmy's friendship with Rollo?
    10·1 answer
  • Given an array of integers a, your task is to calculate the digits that occur the most number of times in the array. Return the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!