You are on page 1of 12

FUNDAMENTALS OF SOFTWARE DEVELOPMENT

ASSIGNMENT - 1
SUBMITTED TO :
SUBMITTED BY :
SUBMITTED DATE :
Questions

1. You are required to design a complete system which will enable you to
calculate the actual amount of salary which an employee is to obtain from
the company based on the income tax provided below.

Salary Range Income Tax(%)


0 to < 3000 0
3000 to < 5000 6
5000 to < 7000 8
7000 to < 8000 12
8000 to < 9000 16
>=9000 40

Answer:

Pseudo code

Start
Input Salary(S)
If S < 3000
Print S
Else if 3000<S<5000
B= 6 / 100 * S
Print B
Else if 5000 < S < 7000
B = 8 / 100 * S
Print B
Else if 7000 < S < 8000
B = 12 / 100 * S
Print B
Else if 8000 < S < 9000
B = 16 / 100 * S
Print B
Else
B = 40 / 100 * S
End if
End

Flowchart
2. Find simple interest. Write pseudo code and draw a flowchart. SI = (P
* T * R) / 100. IF SI value is greater than 20, print “Greater”.

Answer:

Pseudo code

Start
Input (P, R, T)
SI = (P * R * T) / 100
If SI > 20
Print “Greater”
End

Flowchart
Python is a popular high-level programming language that was created in the late
1980s by Guido van Rossum. It is a versatile, object-oriented, and interpreted
language that is widely used in various areas, including web development, data
analysis, artificial intelligence, scientific computing, and more.

Here are some key features and characteristics of Python:

1. Easy to Learn: Python has a simple and easy-to-learn syntax that makes it a
great choice for beginners.
2. Interpreted: Python is an interpreted language, which means that it does not
need to be compiled before execution. This makes it easy to write and test
code quickly.
3. Object-Oriented: Python is an object-oriented language, which means that it
supports the concepts of classes and objects, encapsulation, inheritance, and
polymorphism.
4. Dynamically Typed: Python is dynamically typed, which means that the data
type of a variable is determined at runtime.
5. Large Standard Library: Python comes with a large standard library that
provides a range of tools and modules to accomplish various tasks.
6. Cross-Platform: Python can be run on multiple platforms, including Windows,
Linux, and macOS.
7. Extensible: Python can be extended using various modules, libraries, and
frameworks.
8. Popular: Python is one of the most popular programming languages, with a
large and active community of developers.

Some common use cases of Python include:

1. Web Development: Python can be used to create web applications using


frameworks such as Django, Flask, and Pyramid.
2. Data Analysis: Python is widely used in data analysis and visualization, thanks
to libraries like Pandas, NumPy, and Matplotlib.
3. Artificial Intelligence: Python is a popular choice for developing AI and
machine learning applications, using libraries like TensorFlow, Keras, and
Scikit-learn.
4. Scientific Computing: Python is commonly used in scientific computing,
thanks to libraries like SciPy, SymPy, and PyTorch.

Overall, Python is a versatile and powerful language that is well-suited for a wide
range of applications.
To become very good at Python, you can follow these steps:

1. Learn the basics: Start with the basics of Python, including variables, data
types, functions, control flow, loops, and input/output. You can find many
resources online, including tutorials, books, and videos.
2. Practice coding: Practice writing code in Python as much as possible. Try
solving problems, working on small projects, and experimenting with different
features of the language.
3. Work on real-world projects: Try to work on real-world projects to gain
practical experience. This can help you to apply what you have learned and
develop your skills further.
4. Read Python documentation: Read the official documentation for Python and
its libraries. This can help you to understand the language and its features in
more detail.
5. Participate in online communities: Join online communities such as Stack
Overflow, Reddit, and GitHub, where you can ask questions, share your code,
and collaborate with other developers.
6. Attend Python events: Attend local Python meetups or conferences to meet
other Python developers and learn more about the language.
7. Learn from others: Learn from other experienced Python developers by
reading their code, collaborating on projects, and asking for feedback.
8. Keep up-to-date: Keep up-to-date with the latest trends, libraries, and
frameworks in the Python ecosystem. Follow blogs, newsletters, and podcasts
to stay informed.

Remember, becoming very good at Python requires consistent practice and


dedication. Keep coding, keep learning, and keep improving.
here are some examples of code written in Python for different scenarios:

1. Web Development:

python
from flask import Flask

app = Flask(__name__)

@app.route('/')
def hello():
return 'Hello, World!'

if __name__ == '__main__':
app.run()

2. Data Analysis:

python
import pandas as pd

data = pd.read_csv('data.csv')
mean = data['values'].mean()
std = data['values'].std()
print('Mean:', mean)
print('Standard deviation:', std)

3. Artificial Intelligence:

python
import tensorflow as tf

model = tf.keras.Sequential([
tf.keras.layers.Dense(64, activation='relu'),
tf.keras.layers.Dense(10, activation='softmax')
])

model.compile(optimizer='adam', loss='categorical_crossentropy',
metrics=['accuracy'])

model.fit(x_train, y_train, epochs=10, validation_data=(x_test,


y_test))

4. Scientific Computing:

python
import numpy as np

x = np.linspace(0, 2*np.pi, 100)


y = np.sin(x)

import matplotlib.pyplot as plt

plt.plot(x, y)
plt.show()
5. Automation:

python
import os

directory = '/path/to/directory'

for filename in os.listdir(directory):


if filename.endswith('.txt'):
with open(os.path.join(directory, filename), 'r') as f:
content = f.read()
# do something with the file content

These are just a few examples of the many different scenarios where Python can be
used. The syntax and functionality of Python can be adapted to many different
situations, making it a versatile and powerful language.

Harvard University offers a course on Python called CS50x: Introduction to Computer


Science, which is available online for free through edX. Here are the course details:

Course Name: CS50x: Introduction to Computer Science Institution: Harvard


University Platform: edX

Course Description: This course provides an introduction to computer science and


programming using Python. Students will learn the basics of computer science and
programming, including problem-solving, algorithms, data structures, and debugging.
The course covers topics such as control structures, functions, recursion, data
abstraction, and object-oriented programming. Students will also gain experience with
web programming, SQL, and other related technologies.

Course Syllabus:

1. Week 0: Scratch
2. Week 1: C
3. Week 2: Arrays
4. Week 3: Algorithms
5. Week 4: Memory
6. Week 5: Data Structures
7. Week 6: Python
8. Week 7: SQL
9. Week 8: HTML, CSS, JavaScript
10. Week 9: Flask
11. Week 10: Ethics

Course Format: The course is self-paced and consists of video lectures, quizzes,
problem sets, and programming assignments. There are also optional discussion
forums and live office hours with course staff. The course can be audited for free or a
verified certificate can be obtained for a fee.
Prerequisites: No prior programming experience is required. The course is designed
for beginners.

Overall, the CS50x course at Harvard is a comprehensive introduction to computer


science and programming using Python. It is a great resource for anyone looking to
learn Python and gain a solid foundation in computer science.

Asia Pacific University (APU) in Malaysia also offers courses in Python. Here are
some details:

Course Name: Python Programming Institution: Asia Pacific University (APU)


Platform: On-campus

Course Description: This course provides an introduction to programming using


Python. Students will learn the basics of computer programming, including control
structures, data types, functions, and input/output. The course covers topics such as
lists, tuples, dictionaries, modules, and file handling. Students will also gain
experience with object-oriented programming concepts such as classes, objects,
inheritance, and polymorphism.

Course Syllabus:

1. Introduction to Python
2. Control Structures
3. Functions
4. Lists and Tuples
5. Dictionaries
6. Modules
7. File Handling
8. Object-Oriented Programming
9. Classes and Objects
10. Inheritance and Polymorphism
11. Exceptions and Debugging
12. GUI Programming
13. Database Connectivity

Course Format: The course is taught on-campus and consists of lectures, tutorials, and
practical sessions. Students will work on programming assignments and projects
throughout the semester. The course is assessed through a combination of coursework
and exams.

Prerequisites: No prior programming experience is required. However, students


should have a basic understanding of computer systems and software applications.

Overall, the Python Programming course at Asia Pacific University is a great option
for students looking to learn programming using Python. The course covers a wide
range of topics and provides hands-on experience with programming assignments and
projects.
Here's an example in Python to connect two laptops and share large files using
sockets:

On the sender laptop:

python
import socket

HOST = '192.168.0.2' # IP address of the receiver laptop


PORT = 12345 # Port number to connect

# Connect to the receiver laptop


s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))

# Open the file to be sent


with open('large_file.zip', 'rb') as f:
data = f.read(1024) # Read 1 KB of data at a time
while data:
s.send(data) # Send the data over the socket
data = f.read(1024) # Read the next 1 KB of data

s.close() # Close the socket connection

On the receiver laptop:

python
import socket

HOST = '192.168.0.1' # IP address of the sender laptop


PORT = 12345 # Port number to connect

# Listen for incoming connections


s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))
s.listen()

# Accept the incoming connection


conn, addr = s.accept()

# Receive the file data


with open('received_file.zip', 'wb') as f:
data = conn.recv(1024) # Receive 1 KB of data at a time
while data:
f.write(data) # Write the data to a file
data = conn.recv(1024) # Receive the next 1 KB of data

conn.close() # Close the connection


s.close() # Close the socket

In this example, the sender laptop opens the file to be sent and sends it over a socket
connection to the receiver laptop. The receiver laptop listens for incoming
connections and accepts the connection from the sender laptop. It then receives the
file data and writes it to a file on the receiver laptop. Note that the IP address and port
number used in the example would need to be replaced with the actual IP addresses
and port numbers of the laptops being used.

You might also like