Write Truth Table Propositional Formula P Q P R Eight Rows Table Q43869106
Write down the truth table for the propositional formula (p∨ ¬q)⇒ (p ⇔ r). There should be eight rows in your table
Expert Answer
Answer to Write down the truth table for the propositional formula (p∨ ¬q) ⇒ (p ⇔ r). There should be eight rows in your ta…
Write Two Java Methods Convert 2 S Complement Binary Number Decimal Vice Versa Must Write Q43864974
Write two Java methods to convert a 2’s complement binary numberto decimal and vice versa. You must write JUnit tests to test thecorresponding code. Test for different size binary numbers anddecimals. DO NOT use any shortcuts or predefinedmethods other than Math class methods. The method declarations touse are also provided below. You may create helper methods toremove the redundancy but the method signatures of those belowcannot be changed.
// Takes an array of bits to returnthe corresponding
// decimal equivalent.
public static int convert2sCompToDecimal(char[] bits)
// Takes a decimal and returns the 2scomplement equivalent.
// Assume that the decimalvalue won’t require more than 16 bits.
public static char[]convertDecimalTo2sComp(int decimal)
Here’s a sample JUnit test for one of the methods above.
@Test
public void testNegative2sComp() {
char data[] = {‘1’, ‘0’, ‘1’, ‘0’, ‘0’};
assertEquals(-12,Convert.convert2sCompToDecimal(data));
}
Expert Answer
Answer to Write two Java methods to convert a 2’s complement binary number to decimal and vice versa. You must write JUnit tests…
Write Two Java Methods Convert 2 S Complement Binary Number Decimal Vice Versa Must Write Q43875125
Write two Java methods to convert a 2’s complement binary numberto decimal and vice versa. You must write JUnit tests to test thecorresponding code. Test for different size binary numbers anddecimals. DO NOT use any shortcuts or predefined methods other thanMath class methods. The method declarations to use are alsoprovided below. You may create helper methods to remove theredundancy but the method signatures of those below cannot bechanged.
// Takes an array of bits to return the corresponding
// decimal equivalent.
public static int convert2sCompToDecimal(char[] bits)
// Takes a decimal and returns the 2s complement equivalent.
// Assume that the decimal value won’t require more than 16bits.
public static char[] convertDecimalTo2sComp(int decimal)
Here’s a sample JUnit test for one of the methods above.
@Test public void testNegative2sComp() {
char data[] = {‘1’, ‘0’, ‘1’, ‘0’, ‘0’};
assertEquals(-12, Convert.convert2sCompToDecimal(data)); }
Expert Answer
Answer to Write two Java methods to convert a 2’s complement binary number to decimal and vice versa. You must write JUnit tests…
Write Two Scnrnextint Statements Get Input Values Birthmonth Birthyear Write Statement Out Q43841815
Write two scnr.nextInt statements toget input values into birthMonth and birthYear. Then write astatement to output the month, a slash, and the year. End withnewline.
The program will be tested with inputs 1 2000 and then with inputs5 1950. Ex: If the input is 1 2000, the output is:
1/2000
Note: The input values come from user input, so be sure to usescnr.nextInt statements, as in birthMonth = scnr.nextInt();, to getthose input values (and don’t assign values directly, as inbirthMonth = 1).
import java.util.Scanner;
public class InputExample {
public static void main(String [] args) {
Scanner scnr = new Scanner(System.in);
int birthMonth;
int birthYear;
BirthMonth = scnr.nextInt(“1/2000”);
}
}
Expert Answer
Answer to Write two scnr.nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output th…
Write Two Seperate C Programs 1 Create Program Class One Constructor Receive Information T Q43906130
Write two seperate C# programs:#:1Create a program with a class that has one constructor toreceive the information and three Value-Returning Method to returnthe results. The class will perform all the calculations. Classdoes not use any console commands (read and write).The main will pass the input to the class and display theresults. Void methods in main to display heading and instructions.After entering sales and sales increase percent (whole number notdecimal), the program will calculate the amount of projected salesincrease for each department and total sales increase
#:2code an application that determines how many gallons of wateris needed for a pool. Create Void Methods for the Header andDirections. Create 3 Value-Returning Methods that will returnlength, width, and height. Create another Value-Returning methodthat will accept 3 arguments (length, width, and height) and returnthe number of gallons needed. Use Math.Ceiling for the number ofgallons. To calculate the gallons needed: 1 cubic foot of poolneeds 7.5 gallons and declare as a constant.
Expert Answer
Answer to Write two seperate C# programs:#:1Create a program with a class that has one constructor to receive the information and …
Write Ultimate Tic Tac Toe 9 9 Base 3 3 Tic Tac Toe Code High School Ap Java 3 3 Tic Tac T Q43834932
How to write Ultimate Tic Tac Toe(9*9) ?????
(base on this 3*3 Tic tac toe code below )
High school AP Java
3*3 tic tac toe:
import java.util.*;
public class tictactoe
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
String[] []board = new String[3][3];
boolean win = false, full=false;
int turn = 0;
for(int row=0; row<board.length;row++)
{
for(int col = 0; col<board[0].length;col++)
{
board[row][col]=” “;
}
}
//printBoard(board);
while(!win&&!full)
{
int row,column;
do
{
System.out.println(“enter row and column”);
row = scan.nextInt()-1;
column = scan.nextInt()-1;
}while(!board[row][column].equals(” “)|| row>3 || row<0 ||column>3 || column<0);
if(turn%2==0)
board[row][column]=”X”;
else
board[row][column]=”O”;
printBoard(board);
System.out.println(“full = ” + full);
System.out.println(“win = ” + win);
turn++;
if(turn==9)
full=true;
for(int x=0;x<3;x++)
{
if(board[x][0].equals(“X”)&&board[x][1].equals(“X”)&&board[x][2].equals(“X”))
{
System.out.println(“X wins”);
win=true;
}
if(board[0][x].equals(“X”)&&board[1][x].equals(“X”)&&board[2][x].equals(“X”))
{
System.out.println(“X wins”);
win=true;
}
}
if(board[0][0].equals(“X”)&&board[1][1].equals(“X”)&&board[2][2].equals(“X”))
{
System.out.println(“X wins”);
win=true;
}
if(board[0][2].equals(“X”)&&board[1][1].equals(“X”)&&board[2][0].equals(“X”))
{
System.out.println(“X wins”);
win=true;
}
for(int o=0;o<3;o++)
{
if(board[o][0].equals(“O”)&&board[o][1].equals(“O”)&&board[o][2].equals(“O”))
{
System.out.println(“O wins”);
win=true;
}
if(board[o][0].equals(“O”)&&board[1][o].equals(“O”)&&board[2][o].equals(“O”))
{
System.out.println(“O wins”);
win=true;
}
}
if(board[0][0].equals(“O”)&&board[1][1].equals(“O”)&&board[2][2].equals(“O”))
{
System.out.println(“O wins”);
win=true;
}
if(board[0][2].equals(“O”)&&board[1][1].equals(“O”)&&board[2][0].equals(“O”))
{
System.out.println(“O wins”);
win=true;
}
}
}
public static void printBoard(String [][] board)
{
for(int row=0; row<board.length; row++)
{
for(int col=0; col<board[0].length;col++)
{
if(col==0)
System.out.print(board[row][col]);
else
System.out.print(” | “+ board[row][col]);
}
System.out.println();
if(row<2)
System.out.println(“———-“);
}
}
}
thank you!!!!!!
Expert Answer
Answer to How to write Ultimate Tic Tac Toe(9*9) ????? (base on this 3*3 Tic tac toe code below ) High school AP Java 3*3 tic tac…
Write Vba Code Play One Round Word Game 2 Questions Answer 4 Characters Cell Al Write Tex Q43828680
USE EXCEL VBA!

Write a VBA code to play one round of” Word Game” with 2 questions (each has an answer with 4 characters). In Cell Al, write the text of the first question. You can ask anything you want. Please create 5 different questions and show any of them randomly each time I start the game. There should be 3 buttons on the screen: Start • Buy a letter • Submit the answer The rules are as below: – There is no time limit. – When I click on Start, show me a question in Cell Al. – The answer should be hidden in A3 to D3 – If I click on “Buy a letter”, give me a hint by showing a random letter in the word (it could be any of 4 characters). If I click on this button again, give me another random letter in the answer and so on. To submit my answer, I should fill in the blanks in A3 to D3 and then click on “Submit my answer”. When I submit my answer for the question, calculate my score. If my answer is correct I win 400 points minus 100 times of the number of letters I bought. If my answer is wrong I lose 400 points. Show my score in Cell A5. If I click on Start button again, please restart the game for the second round and show me a different question. The same rules will be applied for the second question and when I submit my answer, my final score will be shown in Cell A5. Here is an example. This is how it looks when I click on “Start” button. 1 What’s the capital of Italy? START BUY SUBMIT This is how it looks when I click on “Buy” once. 1 What’s the capital of Italy? START BUY SUBMIT Show transcribed image text Write a VBA code to play one round of” Word Game” with 2 questions (each has an answer with 4 characters). In Cell Al, write the text of the first question. You can ask anything you want. Please create 5 different questions and show any of them randomly each time I start the game. There should be 3 buttons on the screen: Start • Buy a letter • Submit the answer The rules are as below: – There is no time limit. – When I click on Start, show me a question in Cell Al. – The answer should be hidden in A3 to D3 – If I click on “Buy a letter”, give me a hint by showing a random letter in the word (it could be any of 4 characters). If I click on this button again, give me another random letter in the answer and so on. To submit my answer, I should fill in the blanks in A3 to D3 and then click on “Submit my answer”. When I submit my answer for the question, calculate my score. If my answer is correct I win 400 points minus 100 times of the number of letters I bought. If my answer is wrong I lose 400 points. Show my score in Cell A5. If I click on Start button again, please restart the game for the second round and show me a different question. The same rules will be applied for the second question and when I submit my answer, my final score will be shown in Cell A5. Here is an example. This is how it looks when I click on “Start” button. 1 What’s the capital of Italy? START BUY SUBMIT This is how it looks when I click on “Buy” once. 1 What’s the capital of Italy? START BUY SUBMIT
Expert Answer
Answer to Write a VBA code to play one round of” Word Game” with 2 questions (each has an answer with 4 characters). In Cell Al, w…
Write Verilog Code Booth S Multiplier 4 Bit Signed Numbers Fsm Datapath Clock Reset Start Q43793495
Write a verilog code for Booth’s Multiplier 4 bit signed numberswith fsm datapath clock reset and start inputs over there .
Expert Answer
Answer to Write a verilog code for Booth’s Multiplier 4 bit signed numbers with fsm datapath clock reset and start inputs over the…
Write Verilog Verilog Code 4 Bit Booth S Algorithm Using Fsm Datapath Details 72 Datapath Q43793368
Write a VERILOG (verilog) code for 4 bitBooth’s algorithm using fsm and datapath. Details arebelow.
7.2 Datapath DesignTo achieve the signed binary numbermultiplication based on the Booth’s algorithm,datapath requirescertain logic blocks including;three 4-bit registers to store andan arithmetic shiftrightM, A and Q values and a 1-bit register tostore and anarithmetic shift rightQ-1value. An ALU will be used toperform arithmetic operations(A+M/A-M)and a down counter tokeeptrack of the number of operationsof FSMbased on the number ofbits that the datapath is designed for. This design should follow aparametric model so that the bit size of the multiplier can beadjusted. Firstly, use block diagram representation and design thedatapath for Boot’s Algorithm, then write a parameterizedVerilogcodeto defineyour datapath. Only 4-bit-user inputs(M andQ)are external inputs to the datapath and the CLK, RSTand the othercontrol signals should come from the FSM.
7.3FSM DesignControl unit of this datapath will be implementedby the Booths_FSMas described in the lectures. The multipliercontrol FSM will have three external input START, CLK and RST. Oncea Startsignal is received the Booth algorithm for multiplicationprocesswill start and willcontinue until n(number of bits) in thedown counter= 0.Add an asynchronous RSTsignal and out_statesignalto the design for debugging your FSM. FSM prepared in Experiment 6can help you to implement Booths_FSM. Draw the state diagram forthe FSMshowing all the inputs, outputs, and the state transitionsclearly.
Expert Answer
Answer to Write a VERILOG (verilog) code for 4 bit Booth’s algorithm using fsm and datapath. Details are below. 7.2 Datapath Des…
Write Well Documented Commented Program Lc Using One Loop One Statement Prints Integers 1 Q43868257
Write a well-documented (commented) program, “LC,” that, usingone “for loop” and one “if statement,” prints the integers from 1to 100 with ten integers per line.
Expert Answer
Answer to Write a well-documented (commented) program, “LC,” that, using one “for loop” and one “if statement,” prints…