Find Jobs
Hire Freelancers

Python control structure exampe program -- 2

$10-30 USD

Ditutup
Disiarkan lebih dari 8 tahun yang lalu

$10-30 USD

Dibayar semasa penghantaran
Comparing Times Mus be hand written into python IDE and written in 3.5 and saved as [login to view URL] file Write a function called time_compare that will have 4 parameters. These four integers represent 2 times, that is hour and minute of the first time, then the hour and minute of the second time. It returns an integer, which will be 0, 1 or 2. 0 means the two times were the same. 1 means that the first time came before the second one. 2 means the first time came after the second one. Example calls: compare(1,2,3,4) would return 1 because 1:02 comes before 3:04. compare (12, 19, 12, 1) would return 2 because 12:19 comes after 12:01. compare (3, 4, 3, 4) would return 0 because they are the same time. Each function that returns a value uses ONE return statement at the bottom of the function definition. Use a variable to hold the return value until execution is done in the function, then return that variable. The compare function does NOT do any input from the keyboard or output to the screen. Its interaction with the rest of the program is through its parameters and its return value. compare the two hours first. If they are different, you have your answer without having to look at the minutes at all. You do NOT want to write a main function for this program. Instead, open your file in your IDE. in the shell, type in a call to the function, like "time_compare(12,15,15,3)". This means you want to compare times 12:15 and 15:03. The result should be a 1. Develop 4 test cases for this program. Example: "first time comes after second time, hour1 after hour2", 13, 20, 8, 15 (as inputs), expected return value is 2. List them in the program file as comments at the bottom of the file Small project looking to spend around $10
ID Projek: 8766002

Tentang projek

7 cadangan
Projek jarak jauh
Aktif 8 tahun yang lalu

Ingin menjana wang?

Faedah membida di Freelancer

Tetapkan bajet dan garis masa anda
Dapatkan bayaran untuk kerja anda
Tuliskan cadangan anda
Ianya percuma untuk mendaftar dan membida pekerjaan
7 pekerja bebas membida secara purata $20 USD untuk pekerjaan ini
Avatar Pengguna
A proposal has not yet been provided
$12 USD dalam 1 hari
4.9 (954 ulasan)
7.4
7.4
Avatar Pengguna
Hi, I teach algorithms and data structures at a univesity, I can finish this project in less than one hour without any doubt
$25 USD dalam 3 hari
4.7 (97 ulasan)
6.2
6.2
Avatar Pengguna
I have seen your requirements. Please open chat. ++++++++++++====================+++++++++++++++=============================
$30 USD dalam 1 hari
4.4 (6 ulasan)
2.7
2.7
Avatar Pengguna
A proposal has not yet been provided
$15 USD dalam 1 hari
5.0 (2 ulasan)
1.2
1.2
Avatar Pengguna
I can do this project in a couple of hours and it will work perfectly. Couple of years experience in programming
$10 USD dalam 1 hari
0.0 (0 ulasan)
0.0
0.0
Avatar Pengguna
Hello I am an experienced developer and would be able to help you in the development of this program I have attached a bid being my time and cost if you are interested or need more information please get in touch
$35 USD dalam 30 hari
0.0 (0 ulasan)
0.0
0.0

Tentang klien

Bendera UNITED STATES
campton, United States
5.0
13
Kaedah pembayaran disahkan
Ahli sejak Jan 12, 2012

Pengesahan Klien

Terima kasih! Kami telah menghantar pautan melalui e-mel kepada anda untuk menuntut kredit percuma anda.
Sesuatu telah berlaku semasa menghantar e-mel anda. Sila cuba lagi.
Pengguna Berdaftar Jumlah Pekerjaan Disiarkan
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Memuatkan pratonton
Kebenaran diberikan untuk Geolocation.
Sesi log masuk anda telah luput dan telah dilog keluar. Sila log masuk sekali lagi.