Find Jobs
Hire Freelancers

Python control structure exampe program -- 2

$10-30 USD

Chiuso
Pubblicato più di 8 anni fa

$10-30 USD

Pagato al completamento
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
Rif. progetto: 8766002

Info sul progetto

7 proposte
Progetto a distanza
Attivo 8 anni fa

Hai voglia di guadagnare un po'?

I vantaggi delle offerte su Freelancer

Imposta il tuo budget e le scadenze
Fatti pagare per il lavoro svolto
Delinea la tua proposta
La registrazione e le offerte sui lavori sono gratuite
7 freelance hanno fatto un'offerta media di $20 USD
Avatar dell'utente
A proposal has not yet been provided
$12 USD in 1 giorno
4,9 (954 valutazioni)
7,4
7,4
Avatar dell'utente
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 in 3 giorni
4,7 (97 valutazioni)
6,2
6,2
Avatar dell'utente
I have seen your requirements. Please open chat. ++++++++++++====================+++++++++++++++=============================
$30 USD in 1 giorno
4,4 (6 valutazioni)
2,7
2,7
Avatar dell'utente
A proposal has not yet been provided
$15 USD in 1 giorno
5,0 (2 valutazioni)
1,2
1,2
Avatar dell'utente
I can do this project in a couple of hours and it will work perfectly. Couple of years experience in programming
$10 USD in 1 giorno
0,0 (0 valutazioni)
0,0
0,0
Avatar dell'utente
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 in 30 giorni
0,0 (0 valutazioni)
0,0
0,0

Info sul cliente

Bandiera: UNITED STATES
campton, United States
5,0
13
Metodo di pagamento verificato
Membro dal gen 12, 2012

Verifica del cliente

Grazie! Ti abbiamo inviato tramite email il link per richiedere il tuo bonus gratuito.
Non è stato possibile inviarti l'email. Riprova per piacere.
di utenti registrati di lavori pubblicati
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Caricamento anteprima
Autorizzazione per la geolocalizzazione concessa.
La tua sessione è scaduta ed è stato effettuato il log out. Accedi nuovamente per piacere.