Ask a question from expert

Ask now

CP30681E: Introduction to Software Development

38 Pages6072 Words250 Views
   

Added on  2021-04-21

CP30681E: Introduction to Software Development

   Added on 2021-04-21

BookmarkShareRelated Documents
INTRODUCTION TO SOFTWARE DEVELOPMENTMODULE CODE: CP30681ELOG BOOKSTUDENT ID: XXXXXXXXXXXSCHOOL OF COMPUTING AND ENGINEERINGUNIVERSITY OF WEST LONDON
CP30681E: Introduction to Software Development_1
ISD lab sheet week 1First week of the course introduced about the use of programming tools and code repositories.Next the introduction to computer and its uses were demonstrated. We were introduced brieflyabout the hardware and software, application layers and programming languages.Questions:1.What is a code repository (often also called version control system) used for? Ans.: A code repository is a place to store all your programs and its documentations. It can bestored either locally or online. The code repository software provides the ways to maintain thevarious versions of the same program/software under development and keep track of all thechanges being made in different versions of the program as being developed. We are usingonline code repository website i.e. www.github.com to manage all the program codes we goingto learn and develop as part of our assignments. 2.Why is it advantageous to use a code repository?Ans.: The main advantages of using a code repository are:i)It provides facility to collaborate with other team members of the projectii)It is used as backup and restore option of the project.iii)It maintains the various different version of the project and we can to back to anyolder version if anything goes wrong with the current version.iv)It also used for documentation purpose of the project concerned3.Describe the different “layers” of Software that exist on a typical computer and explain whythere are different layers of software.Ans.: The different layers of software which exist in a typical computers are: System Software,and Application software. The system software layer is used as an interface between user andthe hardware. It takes all the instructions and command from the user and convert it tomachine language and get the task done by the underlying hardware. It then provide the resultto user in user understandable language or format.
CP30681E: Introduction to Software Development_2
4.Describe what an algorithm is and explain why it is a useful “tool” to translate from ahuman level problem (we can think of) to a computer program. Ans.: Algorithm is a set of instructions to solve a problem by a computer written in Englishlanguage. It does not uses the usual keyword of any programming language, but write theinstructions step by step in a logical manner to solve the given problem.
CP30681E: Introduction to Software Development_3
WEEK 2 - PRACTICAL SESSION 2In second week we learnt about what computer program is and learnt what are computer programare made up of namely, keywords, symbols, operators and syntax. We further learnt how a highlevel language program is converted to machine language code which computer uses to executethe program. We were introduced about the concept of algorithms and what is importance of itduring program development. We learnt how to write algorithms to solve day to day problems.Then we learnt about compilers and interpreters and how they are used to convert a high levellanguage program to machine language (binary language). We also learnt about the various typesof programming language namely, machine language, assembly language and high level languages.Then we were introduced about the basics of PYTHON language, its history, and language shell –IDLE.Wewereintroduced next about the statements and expressions in PYTHON and difference between them.We also learnt about the proper indentation and spacing in PYTHON program. And lastly we learntthe command INPUT which is used take input from the user.TASKS:1)Write an algorithm that describes how to make scrambled eggs, try to use controlwords, like IF, WHEN, UNTIL, WHILE, WAIT, AND, OR. Ans. :1.Take two eggs and break them and put in a bowl. Put some salt to taste,black pepper, red pepper as desired.2.Beat the eggs for about half a minute in the bowl till eggs become fluffy.3.Take a frying pan and put some oil or butter in the pan and heat it 4.Wait for butter to melt or oil to get heated5.Put egg in the pan6.While egg not cookeda.Stir the eggs in the frying pan till cooked7.End while8.If other ingredients need a.Add other ingredients like cheese, tomatoes etc.9.End if10. Put the cooked egg in a plate and serve hot
CP30681E: Introduction to Software Development_4
2) Is Idle (the Python language shell) an Interpreter or an Compiler or both? Explainyour answer. Ans. : The python language shell – IDLE is an interpreter as it take one command at atime and execute it. It works like an interpreter. 3) Write a command in the Idle shell that says “Hello world”4) Write a program that produces the following output: Hello WorldI am in my ISD class right nowAns. :Program :print("Hello World") # print command is used to give output on the screenprint("I am in my ISD class right now")
CP30681E: Introduction to Software Development_5
5) Write a program that asks the user for his/her name and produces an output like: Hi there, what is your name?>User input to be read<Hello “User name”How are you?Ans. : PROGRAM :username = input("Hi there, whats your name ? ") # input is used to take input from keyboardprint("Hello")print(username)print("How are you ?")
CP30681E: Introduction to Software Development_6
WEEK 3 – PRACTICAL SESSION 3This week we were introduced about the fundamentals of PYTHON programming. We learnt aboutthe how to use # (hash) character to write single line comments. Next we learnt how to write aprogram and save the program and compile and execute the program.Next we learnt about variable, data types of variable in python and how to convert values todifferent data types using type casting commands like int(), float(), str().We also created the account in online repository – www.github.com and learnt how to use itupload the code to the website.TASKS:1)Write a program that asks for two numbers (Python has all the basicmathematical functions in place, like +,- etc.), adds them up and displays theresult.Ans.:PROGRAM:num1 = int(input("Enter First number : "))num2 = int(input("Enter Second number : "))sum = num1 + num2print("sum is : " + str(sum)) # str() function is used to convert the sum variable to string type
CP30681E: Introduction to Software Development_7
2) Answer the questions by implementing the code and run it.a)What will the output be from the following code?num = 4num*=2num1=num+2num1+=3print(num1)Ans. : The output is : 13 ( the value of num1 = 13 )b)What do the following lines of code output? Why do they give a different answer?print(2 / 3)print(2 // 3)Ans.: 0.66666666666666660The 2/3 give output as0.6666666666666666 as it performs a normal division The 2//3 gives output as 0 because it performs integer division. It gives output of quotient valueand discard all values after the decimal point.
CP30681E: Introduction to Software Development_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Introduction to Software Development - Desklib
|41
|6553
|184

Lecture on Problem Solving & Flowcharts
|36
|1691
|24

Definition of Algorithm and Process of Building an Application
|8
|1804
|83

AP Computer Science A: Unit 1: Object Oriented Programming
|19
|3629
|36

Characteristics of Programming
|18
|3047
|208

Computational Thinking and Programming Languages
|8
|1519
|83