100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary computer science alevel ocr notes questions answers and project! £5.99
Add to cart

Summary

Summary computer science alevel ocr notes questions answers and project!

 19 views  0 purchase

This is perfect as it has revision notes, summary notes, detailed notes and even questions and answer. Also a BONUS of example programming projects such as programming a calculator. Worth it!!!!

Preview 2 out of 7  pages

  • February 15, 2023
  • 7
  • 2022/2023
  • Summary
All documents for this subject (2)
avatar-seller
adnanabedin
#ITERATION CODING

#INSTRUCTIONS

# 1) COMPLETE QUESTIONS THAT ARE IN A RED BOX
# 2) DO NOT CHANGE THE MAIN METHOD NAMES!!!!!
# 3) READ COMMENTS FOR HELP
# 4) DELETE "RETURN" KEYWORD IN SOME PLACES
# 5) MAKE SURE THERE ARE NO SYNTAX ERRORS WHEN YOU UPLOAD!!!!

######################################################
# Question 1: Write a function that prints takes a string from a user and print this as many
times the user has specified
######################################################

def question1():
stringInput = input ("Enter a string of your choice : ")
numberOfTimes = int(input("How many times would you like to print this ? "))
return stringInput, numberOfTimes

def question1Main():
x,y = question1()
for i in range (y):
print(x)
#question1Main()


#####################################################
# Question 2: Write a function that takes in a number from the user e.g. 5 and prints the
following pattern If the user enters 5 the following patern would be:
# 1
# 12
# 123
# 1234
# 12345
######################################################




def question2(numberOfTimes):
for i in range(1,numberOfTimes+1):
for j in range(1,i+1):
print(j,end = " " )
print(" ")




def question2Input():

, x = int(input("Enter a number : "))
return x


def question2Main():
numberOfTimes = question2Input()
question2(numberOfTimes)
#question2Main()




######################################################
# Question 3: Write a function that calculates the sum of all numbers from 1 to a given
number
######################################################


def question3(x):
sum = 0
i=0
while i<=x :
sum = sum+i
i+= 1
return sum

def question3Input():
number = int(input("Enter a number >1 : "))
return number


def question3Main():
x = question3Input()
sumNumber = question3(x)
print(sumNumber)

#question3Main()

######################################################
# Question 5: Write a program to print multiplication table of a given number
######################################################


def question5(number):
print("Multiplication table for : ", number)
for i in range(1,11) :
print(number,"x",i,"=", number*i)

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller adnanabedin. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for £5.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

57413 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy revision notes and other study material for 14 years now

Start selling
£5.99
  • (0)
Add to cart
Added