Answer:
Activity Diagrams
Activity. An activity diagram illustrates one individual activity. ...
Action. ...
Calling an Activity (Action) ...
Accepting an Event (Action) ...
Accepting a Time Event (Action) ...
Sending Signals (Action) ...
Edge (Control Flow) ...
Decision Node.
Explanation:
Answer:
There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:
Let a,b be two numbers.
c=a+b;
print(c);
But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:
Let a be the variable where the input numbers are stored.
while(f==1)
{
printf(“Enter number”);
scanf(“Take number into the variable a”);
sum=sum+a;
printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);
scanf(“Take the input into the variable f”);
}
print(Sum)
Explanation:
hi there answer is given mar me as brainliest
Answer:
Enter time 1 HH:MM:SS8:5:22
Enter time 2 HH:MM:SS7:24:37
0:40:45
Explanation:
The program for above in Python is:
from datetime import datetime
s1 = input("Enter time 1 HH:MM:SS")
s2 = input("Enter time 2 HH:MM:SS")
Format1 = '%H:%M:%S'
tdiff = datetime.strptime(s1, Format1) - datetime.strptime(s2, Format1)
print(tdiff)
We are using the datetime class in datetime module for using strptime to find the difference between the two times.
Answer:
Sara: Personal data
Jorge : Personal data + official data.
Wanda: Personal data + students data
Carl: Personal data + official data
Explanation:
Personal data could contain pictures, social security numbers, banking transactions details, passwords, credit card information etc.
Jorge's official data could contain information about various sources that he gets his news from. It could contain password information about his official email. And he connects to the office network, he might pose a threat to the entire network if his PC is infected.
Wanda could leak the student's information. She could also leak her social security numbers, bank details, organization's details etc.
Carl could leak company's information. He can avoid it by staying away from public networks. Installing anti-virus. He should also take great care while accessing various sites and never download harmful files over the internet.
answer:
(i) #include <iostream>
using namespace std;
int main() {
int n1,n2,max;
cin>>n1>>n2;
if(n1>n2)//finding maximum between n1 and n2 in the program directly.
max=n1;
else
max=n2;
cout<<max;
return 0;
}
(ii)
#include <iostream>
using namespace std;
int maximum(int n1 ,int n2)
{
if(n1>n2)//finding maximum between n1 and n2 using function.
return n1;
else
return n2;
}
int main() {
int n1,n2,max;
cin>>n1>>n2;
max=maximum(n1,n2);
cout<<max;
return 0;
}
(iii)
#include <iostream>
using namespace std;
inline int maximum(int n1 ,int n2)
{
return (n1>n2)? n1:n2;
}
int main() {
int n1,n2,max;
cin>>n1>>n2;
max=maximum(n1,n2);//Finding maximum using inline function.
cout<<max;
return 0;
}
Output:-
54 78
78
all three codes give the same output.
Explanation:
In part (i) I have done the operation in the main function directly.
In part(ii) I have used function to calculate the maximum.
In part(iii) I have used inline function to calculate maximum.