Answer:
In C:
#include <stdio.h>
int main() {
int mynum;
scanf("%d", &mynum);
if(mynum%3 == 0 && mynum%5 != 0){
printf("CS"); }
else if(mynum%5 == 0 && mynum%3 != 0){
printf("1714"); }
else if(mynum%3 == 0 && mynum%5 == 0){
printf("CS1714"); }
else {
printf("ERROR"); }
return 0;
}
Explanation:
This declares mynum as integer
int mynum;
This gets user input
scanf("%d", &mynum);
This condition checks if mynum is divided by 3. It prints CS, if true
if(mynum%3 == 0 && mynum%5 != 0){
printf("CS"); }
This condition checks if mynum is divided by 5. It prints 1714, if true
else if(mynum%5 == 0 && mynum%3 != 0){
printf("1714"); }
This condition checks if mynum is divided by 3 and 5. It prints CS1714, if true
else if(mynum%3 == 0 && mynum%5 == 0){
printf("CS1714"); }
This condition checks if num cannot be divided by 3 and 5. It prints ERROR, if true
else {
printf("ERROR"); }
What is media framing?
Answer:
media frame all news items by specific values, facts, and other considerations, and endowing them with greater apparent for making related judgments
Explanation:
Consider the following method.
public int locate(String str, String oneLetter)
{
int j = 0;
while(j < str.length() && str.substring(j, j+1).compareTo*oneLetter < 0)
{
j++;
}
return j;
}
Which of the following must be true when the while loop terminates?
a. j == str.length()
b. str.substring(j, j+1) >= 0
c. j <= str.length() || str.substring(j, j+1).compareTo(oneLetter) > 0
d. j == str.length() || str.substring(j, j+1).compareTo(oneLetter) >= 0
e. j == str.length() && str.substring(j, j+1).compareTo(oneLetter) >= 0
Answer:
All
Explanation:
From the available options given in the question, once the while loop terminates any of the provided answers could be correct. This is because the arguments passed to the while loop indicate two different argument which both have to be true in order for the loop to continue. All of the provided options have either one or both of the arguments as false which would break the while loop. Even options a. and b. are included because both would indicate a false statement.
The Fast as Light Shipping company charges the following rates. Weight of the item being sent Rate per 100 Miles shipped 2kg or less. $0.25 Over than 2 kg but not more than 10 kg $0.30 Over 10 kg but not more than 20 kg. $0.45 Over 20 kg, but less than 50kg. $1.75 Write a program that asks for the weight of the package, and the distance to be sent. And then displays the charge.
Answer:
weight = float(input("Enter the weight of the package: "))
distance = float(input("Enter the distance to be sent: "))
weight_charge = 0
if weight <= 2:
weight_charge = 0.25
elif 2 < weight <= 10:
weight_charge = 0.3
elif 10 < weight <= 20:
weight_charge = 0.45
elif 20 < weight <= 50:
weight_charge = 1.75
if int(distance / 100) == distance / 100:
d = int(distance / 100)
else:
d = int(distance / 100) + 1
total_charge = d * weight_charge
print("The charge is $", total_charge)
Explanation:
*The code is in Python.
Ask the user to enter the weight and distance
Check the weight to calculate the weight_cost for 100 miles. If it is smaller than or equal to 2, set the weight_charge as 0.25. If it is greater than 2 and smaller than or equal to 10, set the weight_charge as 0.3. If it is greater than 10 and smaller than or equal to 20, set the weight_charge as 0.45. If it is greater than 20 and smaller than or equal to 50, set the weight_charge as 1.75
Since those charges are per 100 miles, you need to consider the distance to find the total_charge. If the int(distance / 100) is equal to (distance / 100), you set the d as int(distance / 100). Otherwise, you set the d as int(distance / 100) + 1. For example, if the distance is 400 miles, you need to multiply the weight_charge by 4, int(400/100) = 4. However, if the distance is 410, you get the int(400/100) = 4, and then add 1 to the d for the extra 10 miles.
Calculate the total_charge, multiply d by weight_charge
Print the total_charge
During TCP/IP communications between two network hosts, information is encapsulated on the sending host and decapsulated on the receiving host using the OSI model. Match the information format with the appropriate layer of the OSI model.
a. Packets
b. Segments
c. Bits
d. Frames
1. Session Layer
2. Transport Layer
3. Network Layer
4. Data Link Layer
5. Physical Layer
Answer:
a. Packets - Network layer
b. Segments - Transport layer
c. Bits - Physical layer
d. Frames - Data link layer
Explanation:
When TCP/IP protocols are used for communication between two network hosts, there is a process of coding and decoding also called encapsulation and decapsulation.
This ensures the information is not accessible by other parties except the two hosts involved.
Operating Systems Interconnected model (OSI) is used to standardise communication in a computing system.
There are 7 layers used in the OSI model:
1. Session Layer
2. Transport Layer
3. Network Layer
4. Data Link Layer
5. Physical Layer
6. Presentation layer
7. Application layer
The information formats given are matched as
a. Packets - Network layer
b. Segments - Transport layer
c. Bits - Physical layer
d. Frames - Data link layer
Consider an entity set Person, with attributes social security number (ssn), name, nickname, address, and date of birth(dob). Assume that the following business rules hold: (1) no two persons have the same ssn; (2) no two persons have he same combination of name, address and dob. Further, assume that all persons have an ssn, a name and a dob, but that some persons might not have a nickname nor an address.
A) List all candidate keys and all their corresponding superkeys for this relation.
B) Write an appropriate create table statement that defines this entity set.
Answer:
[tex]\pi[/tex]
Explanation:
when you look directly at a camera lens, it may seen like there is only one lens, but entering light actually passes through a series of lenses, or_____, that bend the light and send it on its way to be focused on the film or digital. chip
Frame
Optics
Flash
SD cARD
Answer:
The answer should be optics...
Explanation:
If aa person is known to have look at a camera lens straight and light passes via a number of lenses, or Optics.
What is Optics?This is known to be an aspect of physics that looks at the attributes and properties of light, such as its relationship with matter, etc.
Therefore, If a person is known to have look at a camera lens straight and light passes via a number of lenses, or Optics.
Learn more about Optics from
https://brainly.com/question/18300677
#SPJ9