Answer:
import java.util.Scanner;
public class CalculatingSales {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int product, quantity;
double total = 0;
while(true) {
System.out.println("Enter product_id and quantity(0 0 to stop): ");
product = sc.nextInt();
quantity = sc.nextInt();
if(product==0 && quantity == 0)
break;
switch (product) {
case 1:
total = total + 2.98*quantity;
break;
case 2:
total = total + 4.50*quantity;
break;
case 3:
total = total + 9.98*quantity;
break;
case 4:
total = total + 4.49*quantity;
break;
case 5:
total = total + 6.87*quantity;
break;
default:
System.out.println("Invalid option");
}
}
System.out.println("total value: "+total);
sc.close();
}
}
Explanation:
- Take the product and quantity as input from user.
- Use a switch statement to multiply the total with their relevant value.
- Display the total value.
Answer:
the save command is located in the file menu
Safe search ,tunnel search
Answer:
function findLongestWord(str) {
var longestWord = str.split(' ').sort(function(a, b) { return b.length - a.length; });
return longestWord[0].length;
}
findLongestWord(InputHere);
Explanation:
Replace InputHere with the input
Sharing network resources requires abiding by certain constraints, as follows:
<span>Security: Organizations present ongoing opportunities for unauthorized shared resources. Security mechanisms should be implemented to provide efficient parameters.Compatibility: Various client-server operating systems may be installed, but the client must have a compatible OS or application to access shared resources. Otherwise, the client may encounter issues that create communication delays and requires troubleshooting.Mapping: Any shared OS hardware drive, file or resource may be accessed via mapping, which requires a shared destination address and naming conventions.<span>File Transfer Protocol (FTP) and File Sharing: FTP is not affected by shared resources because the Internet is FTP’s backbone. File sharing is an LAN concept.</span></span>