Answer:
In Java:
import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String isbn;
System.out.print("First 1:2 digits: ");
isbn = input.nextLine();
if(isbn.length()==12){
int chksum = 0;
for(int i = 0; i<12;i++){
if((i+1)%2==0){ chksum+= 3 * Character.getNumericValue(isbn.charAt(i)); }
else{ chksum+=Character.getNumericValue(isbn.charAt(i)); } }
chksum%=10;
chksum=10-chksum;
if(chksum==10){
System.out.print("The ISBN-13 number is "+isbn+"0");}
else{
System.out.print("The ISBN-13 number is "+isbn+""+chksum); } }
else{
System.out.print("Invalid Input");
} }}
Explanation:
See attachment for explanation where comments are used to explain each line
Let me re-write the proposition:
p↔q⊕(¬p↔¬r)∧¬q.
Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:
p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1
Answer:
Option D. float is the correct answer.
Explanation:
Decimal number contains decimal point. Out of all the given data types, float data type store the number with decimal point.
As the number has to be further used for calculations float ahs to be used. Because the numbers can also be stored in string but cannot be used for further calculations.
Hence,
Option D. float is the correct answer.
A) operating system
It is going to let you "operate" it using the mouse and keyboard