FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpp-programming/OOP1-Lab5/Source2.cpp at main · Raldiii/cpp-programming · GitHub
Raldiii
/
cpp-programming
Public
forked from
Rustam-Z/cpp-programming
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpp-programming
/
OOP1-Lab5
/
Source2.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (22 loc) · 966 Bytes
Breadcrumbs
cpp-programming
/
OOP1-Lab5
/
Source2.cpp
Copy path
File metadata and controls
22 lines (22 loc) · 966 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
Practical Lab Assignment-7(Week 9)
//
ID:U1910049 Name:Rustam Zokirov
//
Program to convert into minutes
#
include
<
iostream
>
using
namespace
std
;
double
converting1
(
double
hours,
double
minutes,
double
seconds) {
//
initializing the variables
return
(hours *
60
) + (minutes)+(seconds /
60
);
//
returning the function "converting"
}
int
main3
() {
double
hours, minutes, seconds;
cout <<
"
Hours:
"
;
cin >> hours;
//
Prompting user for data and
cout <<
"
Minutes:
"
;
//
reading 3 numbers for user
cin >> minutes;
//
!
cout <<
"
Seconds:
"
;
cin >> seconds;
if
(hours >=
0
&& minutes >=
0
&& seconds >=
0
)
//
the program will be executed when all numbers are positive
cout <<
"
The time in minutes is
"
<<
converting1
(hours, minutes, seconds) << endl;
else
//
calling function to calculate the main function
cout <<
"
Invalid inputs!
"
<< endl;
return
0
;
//
indicates that the program will ended successfully
}
Back
|
FazBrowse Home
|
New Git URL