1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Flauer [41]
3 years ago
15

I am having trouble understanding how I got these wrong on my test. Is there something I am missing with xor?

Engineering
1 answer:
GuDViN [60]3 years ago
8 0

Answer:

  your answer is correct

Explanation:

You have the correct mapping from inputs to outputs. The only thing your teacher may disagree with is the ordering of your inputs. They might be written more conventionally as ...

 A B Y

 0 0 1

 0 1 0

 1 0 0

 1 1 1

That is, your teacher may be looking for the pattern 1001 in the last column without paying attention to what you have written in column B.

You might be interested in
Your Java program will be reading input from a file name strInput.txt. Each record contains String firstname String lastName Str
stiks02 [169]

Answer:

The program requires that you have the specified input files and it reads from each file at a time and processes salary in digits, states the city, state and bonus with respective first and last name as requested in the question. Note that you must have access to the mentioned output files for the program to work properly. Below is the java version of the program.

import java.io.File;

import java.io.FileNotFoundException;

import java.io.PrintWriter;

import java.util.Scanner;

class Driver

{

public static void main(String[] args) throws FileNotFoundException

{

Scanner sc = new Scanner(new File("strInput.txt"));

PrintWriter pd = new PrintWriter(new File("strOutputD"));

PrintWriter prf = new PrintWriter(new File("strOutputRF"));

String firstname = "", lastname = "", strSalary = "", status = "", cityState = "", city = "", state = "";

double salary = 0, bonus = 0;

int incorrectRecords = 0;

int dRecords = 0;

int fRecords = 0;

while(sc.hasNextLine())

{

firstname = sc.next();

lastname = sc.next();

strSalary = sc.next();

status = sc.next();

cityState = sc.next();

if(!status.equals("D") && !status.equals("F"))

{

System.out.println("Records is neither D nor F. Skipping this...");

incorrectRecords++;

continue;

}

else if(status.equals("D") || status.equals("F"))

{

char c = ' ';

int i = 0;

for(i=0; i<strSalary.length() && c != '.'; i++)

{

c = strSalary.charAt(i);

if(!Character.isDigit(c))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

if(c == '.')

{

if(i+1 == strSalary.length()-1)

{

if(!Character.isDigit(strSalary.charAt(i)))

{

System.out.println("Char at position " + (i+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

if(!Character.isDigit(strSalary.charAt(i+1)))

{

System.out.println("Char at position " + (i+1+1) + " in salary is not a digit");

incorrectRecords++;

continue;

}

}

else

{

System.out.println("Period is in the wrong position. Expected at " + (strSalary.length()-3) + " but found at " + (i+1));

continue;

}

}

city = cityState.split(",")[0];

state = cityState.split(",")[1];

salary = Double.parseDouble(strSalary);

if(status.equals("D"))

{

bonus = salary * 0.125;

dRecords++;

pd.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

else

{

bonus = salary * 0.18;

fRecords++;

prf.write(firstname + " " + lastname + " " + status + " " + salary + " " + bonus + " " + city + " " + state);

}

}

}

System.out.println("No of D records : " + dRecords);

System.out.println("No of F records : " + fRecords);

System.out.println("No of incorrect records : " + incorrectRecords);

}

}

6 0
3 years ago
The output side of an ideal transformer has 35 turns, and supplies 2.0 A to a 24-W device. Ifthe input is a standard wall outlet
Crank

Answer:

The current drawn from the outlet is 0.2 A

The number of turns on the input side is 350 turns

Explanation:

Given;

number of turns of the secondary coil, Ns = 35 turns

the output current, I_s = 2 A

power supplied, P_s = 24 W

the standard wall outlet in most homes = 120 V = input voltage

For an ideal transformer; output power = input power

the current drawn from the outlet is calculated;

I_pV_p = P_s\\\\I_p = \frac{P_s}{V_p} = \frac{24}{120} = 0.2 \ A

The number of turns on the input side is calculated as;

\frac{N_p}{N_s} = \frac{I_s}{I_p}  \\\\N_p = \frac{N_sI_s}{I_p} \\\\N_p = \frac{35 \times 2}{0.2} \\\\N_p = 350 \ turns

4 0
3 years ago
In a short essay, discuss the question, "How are you an innovator?"
iragen [17]

Answer:

Being innovative means doing things differently or doing things that have never been done before. An innovator is someone who has embraced this idea and creates environments in which employees are given the tools and resources to challenge the status quo, push boundaries and achieve growth.

Explanation:

Hope it helps..

But it's a little bit long..

Correct me if I'm wrong..

7 0
3 years ago
Multiple Choice
Ymorist [56]

Answer:

Sealing agent

Explanation:

Generally, when we have water leaks in almost any building or equipment, we use a sealant. However, this sealant could be of different types depending on the peculiarity of the leakage.

Thus, the correct answer is sealing agent.

5 0
3 years ago
Read 2 more answers
Compressed Air In a piston-cylinder device, 10 gr of air is compressed isentropically. The air is initially at 27 °C and 110 kPa
Helen [10]

Answer:

(a) 2.39 MPa (b) 3.03 kJ (c) 3.035 kJ

Explanation:

Solution

Recall that:

A 10 gr of air is compressed isentropically

The initial air is at = 27 °C, 110 kPa

After compression air is at = a450 °C

For air,  R=287 J/kg.K

cv = 716.5 J/kg.K

y = 1.4

Now,

(a) W efind the pressure on [MPa]

Thus,

T₂/T₁ = (p₂/p₁)^r-1/r

=(450 + 273)/27 + 273) =

=(p₂/110) ^0.4/1.4

p₂ becomes  2390.3 kPa

So, p₂ = 2.39 MPa

(b) For the increase in total internal energy, is given below:

ΔU = mCv (T₂ - T₁)

=(10/100) (716.5) (450 -27)

ΔU =3030 J

ΔU =3.03 kJ

(c) The next step is to find the total work needed in kJ

ΔW = mR ( (T₂ - T₁) / k- 1

(10/100) (287) (450 -27)/1.4 -1

ΔW = 3035 J

Hence, the total work required is = 3.035 kJ

4 0
3 years ago
Other questions:
  • Modify any of the previous labs which would have crashed when non-numeric data was entered by adding exception handling so that
    8·1 answer
  • A seawall with an opening is used to dampen the tidal influence in a coastal area (and limit erosion). The seawall is 2.5 m long
    11·1 answer
  • A resonant six-turn loop of closely spaced turns is operating at 50 MHz. The radius of the loop is λ/30, and the loop is connect
    15·1 answer
  • Two mass streams of the same ideal gas are mixed in a steady-flow chamber while receiving energy by heat transfer from the surro
    11·1 answer
  • Complete the following sentence. Engineers explore biology, chemistry, and physics for use in scenarios.
    8·2 answers
  • You are using a Geiger counter to measure the activity of a radioactive substance over the course of several minutes. If the rea
    6·1 answer
  • What are 5 advantages of wood as a manufacturing or construction​
    12·1 answer
  • if you help then I will thank u by sooo much I will give tons of points but the answer has to be right.
    14·2 answers
  • Which Finance jobs can someone pursue with only a high school diploma? Check all that apply.
    10·2 answers
  • The distribution of SAT scores of all college-bound seniors taking the SAT in 2014 was approximately normal with mean μ=1497 and
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!