b, a 2 to 1 increases doubles speed and reduces speed by half
Answer:
The program to the given question as follows:
Program:
import java.util.*; //import package for user input.
public class Main //defining class Main
{
public static void main(String[] as) //defining main method
{
final double over_time_factor = 1.5; //define final variable
double number_Of_hours,wages,total_Wages=0; //defining variables
System.out.println("Enter hours and wages rate:"); //print message
Scanner obc = new Scanner(System.in); //creating Scanner class object for user input
number_Of_hours = obc.nextDouble(); //taking input
wages = obc.nextDouble(); //taking input
if(number_Of_hours>40) //check condition if number_Of_hours greter then 40
{
total_Wages=40*wages+(number_Of_hours-40)*wages*over_time_factor; //calculate value
}
else //else part
{
total_Wages = number_Of_hours*wages; //calculate total_Wages
}
System.out.println("Total Wages: $"+total_Wages); //print value
}
}
Output:
Enter hours and wages rate:
12
3
Total Wages: $36.0
Explanation:
In the above java program, the package is first imported into the user input and then the class is defined and inside this, the main method is defined, that defines a double type final variable "over_time_factor" is defined that holds a value "1.5", Then double type variable is defined that are " number_Of_hours, wages, and total_Wages", in which first two variables are used for taking input from the user and the third variable is used to calculate their values. After taken input from the user, the conditional statement is used that can be defined as follows:
TCP/IP, a network protocol, is used by a browser to connect to a web server and launch a Hypertext Transfer Protocol. The HTTP tries to get info and provide it for displays.
A web page is a straightforward document that a browser can see. These documents are created using the HTML coding system. Tsi involves the data and the content that can be presented online.
The consumer must either type in URL for the page they want to access via the web or click on the hyperlink that contains the URL.
The Ip identifies the Website browser's Web address, and for the Search engine to comprehend it, they must both utilize the very same normal procedure. The Hypertext Transfer Protocol is the preferred means of communication here between a web browser and a server (HTTP).
Learn more about web page, here:
#SPJ2
Answer:
pkt = int(input("Pocket Number: "))
if pkt == 0:
print("Green")
elif pkt >= 1 and pkt <=10:
if pkt%2 == 0:
print("Black")
else:
print("Red")
elif pkt >= 11 and pkt <=18:
if pkt%2 == 0:
print("Red")
else:
print("Black")
elif pkt >= 19 and pkt <=28:
if pkt%2 == 0:
print("Black")
else:
print("Red")
elif pkt >= 29 and pkt <=36:
if pkt%2 == 0:
print("Red")
else:
print("Black")
else:
print("Error")
Explanation:
The program was written in Python and the line by line explanation is as follows;
This prompts user for pocket number
pkt = int(input("Pocket Number: "))
This prints green if the pocket number is 0
if pkt == 0:
print("Green")
If pocket number is between 1 and 10 (inclusive)
elif pkt >= 1 and pkt <=10:
This prints black if packet number is even
if pkt%2 == 0:
print("Black")
Prints red, if otherwise
else:
print("Red")
If pocket number is between 11 and 18 (inclusive)
elif pkt >= 11 and pkt <=18:
This prints red if packet number is even
if pkt%2 == 0:
print("Red")
Prints black, if otherwise
else:
print("Black")
If pocket number is between 19 and 28 (inclusive)
elif pkt >= 19 and pkt <=28:
This prints black if packet number is even
if pkt%2 == 0:
print("Black")
Prints red, if otherwise
else:
print("Red")
If pocket number is between 29 and 36 (inclusive)
elif pkt >= 29 and pkt <=36:
This prints red if packet number is even
if pkt%2 == 0:
print("Red")
Prints black, if otherwise
else:
print("Black")
Prints error if input is out of range
else:
print("Error")
DMZ
internal network
external network
Answer: DMZ
Explanation:
DMZ is the demilitarized zone network and it is use in providing he various services to the users or customers by using the public internet. It basically contain organizational services in the logical and physical sub-network and usually works in large network.
The main purpose of DMZ that it is use as web server over the internet for reaching to the users and customers. It also add one additional layer in the organization for security purpose.
Some of the services that DMZ provides as web server, DNS and proxy server.
Answer:
Following are the program in the Python Programming Language.
import json #import package
#define function
def read_json(info):
return json.loads(info)#load data in variable
#call and print the function
print(read_json('[{'A': 10}, {'Y': 16}, {'U': 28}]'))
Output:
[{'A': 10}, {'Y': 16}, {'U': 28}]
Explanation:
following are the description of the code
Answer:
#include <iostream>
using namespace std;
struct complex{//structure of comlex number..
double real;
double img;
};
complex add_complex(complex n1,complex n2)//add_complex functrion to add 2 complex numbers..
{
double a,b;//variables to hold the sum of real and imaginary.
complex sum;//result sum complex number.
a=n1.real+n2.real;//adding real parts.
b=n1.img+n2.img;//adding imaginary parts..
sum.real=a;//assinging values to sum.
sum.img=b;
return sum;//returning complex number sum.
}
int main()
{
complex c1,c2,sum;
double a,b;
cout<<"Enter values of c1"<<endl;
cin>>a>>b;
c1.real=a;
c1.img=b;
cout<<"Enter values of c2"<<endl;
cin>>a>>b;
c2.real=a;
c2.img=b;
sum=add_complex(c1,c2);
cout<<"The sum is : "<<sum.real<<" + i"<<sum.img<<endl;
return 0;
}
OUTPUT:-
Enter values of c1
8.5 7.2
Enter values of c2
4.5 3.9
The sum is : 13 + i11.1
Explanation:
First I have created a structure for complex number.Then created a function to add two complex numbers according to the question which returns a complex number.