Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2d8a0ff
modified README.MD
group2BCS1 Mar 18, 2021
f1b5d5a
exercise2.py
group2BCS1 Mar 24, 2021
7536ca8
exercise2.py
group2BCS1 Mar 24, 2021
b7c1910
modified chapter2
group2BCS1 Mar 26, 2021
4609e0a
modified chapter2
group2BCS1 Mar 28, 2021
1c85503
Delete .idea directory
group2BCS1 Apr 6, 2021
28c5f33
Delete src/chapter2 directory
group2BCS1 Apr 6, 2021
c21bee4
assignment3
group2BCS1 Apr 6, 2021
03d7a97
Delete .idea directory
group2BCS1 Apr 6, 2021
81e6f03
Delete prac.py
group2BCS1 Apr 6, 2021
cecbe5d
Delete multi.py
group2BCS1 Apr 6, 2021
b876c2a
assignment
group2BCS1 Apr 6, 2021
f11a065
Merge branch 'main' of https://github.com/group2BCS1/BCS-2021
group2BCS1 Apr 6, 2021
9e60ff0
chapter4
group2BCS1 Apr 18, 2021
4e299d2
exercise1.py
group2BCS1 Apr 6, 2021
c00cf41
Merge remote-tracking branch 'origin/main'
group2BCS1 Apr 18, 2021
8a6cc96
exercise1.py
group2BCS1 Apr 18, 2021
6da462a
modified chapter 4
group2BCS1 Apr 18, 2021
37283af
modified chapter4
group2BCS1 Apr 19, 2021
36a4202
chapter4
group2BCS1 Apr 19, 2021
50cfe97
chapter5
group2BCS1 Apr 22, 2021
0b6bf49
modified chapter5
group2BCS1 Apr 22, 2021
30f46d1
exercis3
group2BCS1 Apr 22, 2021
495db3d
modified exercise3
group2BCS1 Apr 23, 2021
0808eac
modified exercise3
group2BCS1 Apr 26, 2021
902fc24
final version of the program
group2BCS1 May 5, 2021
87d7821
simple version of the program
Mukiibi-G-J May 5, 2021
c87bcca
assignment
group2BCS1 May 16, 2021
b9f8249
Merge branch 'main' of https://github.com/group2BCS1/BCS-2021
group2BCS1 May 16, 2021
a1e76db
project2
group2BCS1 May 21, 2021
8a8113f
modified chapter8
group2BCS1 May 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
MIT License

Copyright (c) 2021 John Businge

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# BCS-2021
This repository is created to collect the assignment solutions for the subject CSC1102 Principles of Programming for the students of Bachelors of Computer Science Year I, in the faculty of Computing and Informatics, MUST.
##Group 2 Members
1. Mukiibi Joseph 2020/BCS/046/ps
2. Okello Benjamin 2020/BCS/055/ps
3. Ahabwe Dickson 2020/BCS/013/ps
4. Asiimwe Timothy 2020/BCS/024/ps
62 changes: 62 additions & 0 deletions mid_term/project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@


def gallon(beg_meter_reading, end_meter_reading):
if end_meter_reading>beg_meter_reading:
gallons=(end_meter_reading-beg_meter_reading)/10
else:
beg_meter_reading=(1000000000-beg_meter_reading)
gallons=(end_meter_reading+beg_meter_reading)/10
return gallons

def output():
print(f'Customer code {customer_code}')
print(f'Beginnig meter reading: {beg_meter_reading:09d}')
print(f'Ending meter reading: {end_meter_reading:09d}')


while True:
try:
customer_code=input('Enter the customer code: ').lower()
beg_meter_reading=int(input('Enter the begining meter reading: '))
end_meter_reading=int(input('Enter the endining meter reading: '))
except:
print('Invalid input')


gallons = gallon(beg_meter_reading, end_meter_reading)
if 0 < beg_meter_reading <9999999999 and 0 < end_meter_reading <9999999999:
if customer_code == 'r':
amount_billed=(5.00+(0.0005*gallons))
amount_billed= round(amount_billed,2)
output()
print(f'Gallons of water used:{gallons}')
print(f'Amount billed: ${amount_billed}')
elif customer_code== 'c':
if gallons<=4000000:
output()
print(f'Gallons of water used:{gallons}')
print(f'Amount billed:${1000.0}')
elif gallons>40000000:
output()
amount_billed=1000+(gallons-4000000)*0.00025
print(f'Gallons of water used:{gallons}')
print(f'Amount billed ${amount_billed}')
elif customer_code=='i':
if gallons<=4000000:
output()
print(f'Gallons of water used:{gallons}')
print(f'Amount billed ${1000.00}')
elif gallons>40000000:
output()
print(f'Gallons of water used:{gallons}')
print(f'Amount billed ${2000.00}')
elif gallons>10000000:
output()
amount_billed=(2000.00+(0.00025)*gallons)
print(f'Amount billed: ${amount_billed}')
else:
print('Ivalid input')
else:
print('Invalid input')


3 changes: 3 additions & 0 deletions src/Project 02/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Project 02/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Project 02/.idea/Project 02.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Project 02/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/Project 02/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Project 02/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading