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
Tom [10]
4 years ago
15

Hi there! I just started my beginner computer science class and I was wondering if anyone wants to help with an assignment i'm h

aving trouble with.
Here are the instructions:

Write a program that contains 3 variables and produces the logic table. You will need to request input from the user to set the variables in the form of T or F for each variable. Try to condense your program so you write a single conditional to produce the table. Place the following at the beginning of your code, with all of your code indented to be in that block, so you have a continuous loop:

while True:


I attatched the logic gate to this question.

Thank you!

Computers and Technology
1 answer:
Alik [6]4 years ago
5 0

After looking at your question, I reasoned you were writing this in python. Here's my code, I hope it helps!

while True:

   v1 = input("Enter value of first variable (T/F) ")

   v2 = input("Enter value of second variable (T/F) ")

   v3 = input("Enter value of third variable (T/F) ")

   print("v1: {}, v2: {}, v3: {} = T".format(v1, v2, v3) if v1 == "T" and v2 == "T" or v1 == "T" and v3 == "T" else "v1: {}, v2: {}, v3: {} = F".format(v1, v2, v3))

You might be interested in
Suppose that the first number of a sequence is x, where x is an integer. Define ; ‍ if is even; ‍ ‍ ‍ if is odd. Then there exis
Anastasy [175]

Answer:

The program is written in c++ , go to the explanation part for it, the output can be found in the attached files.

Explanation:

C++ Code:

#include <iostream>

using namespace std;

int main() {

int x;

cout<<"Enter a number: ";

cin>>x;

int largest = x;

int position = 1, count = 0;

while(x != 1)

{

count++;

cout<<x<<" ";

if(x > largest)

{

largest = x;

position = count;

}

if(x%2 == 0)

x = x/2;

else

x = 3*x + 1;

}

cout<<x<<endl;

cout<<"The largest number of the sequence is "<<largest<<endl;

cout<<"The position of the largest number is "<<position<<endl;

return 0;

}

4 0
3 years ago
The collections framework algorithms are __________, i.e., each of these algorithms can operate on objects that implement specif
Ad libitum [116K]
<h2><em>C.) Polymorphic.</em></h2><h2><em></em></h2>

Just trust a bro, its correct.

4 0
3 years ago
Read 2 more answers
If(moreDate == true)
worty [1.4K]

it's either C or D I am pretty sure that the answer is D

5 0
3 years ago
When encountering another vessel in darkness or reduced visibility, what do visible red and green lights indicate
mina [271]
The sides of the vessel.
5 0
4 years ago
Which devices are likely to include a computer? Select 3 options.
Veronika [31]

Answer:

Cell Phone, ATM Cash Machine, and a GPS Mapping Device

5 0
3 years ago
Other questions:
  • In addition to proposing that planetary orbits are elliptical, what other modification did Kepler make to Copernicus’s model? Pl
    15·2 answers
  • By using colocated, replicated hardware and software, cloud solution providers reduce many threats to IT resources.
    5·1 answer
  • An element in a web page that connects to a different location in the same page or a different page is a _____.
    8·1 answer
  • How can a System Administrator quickly determine which user profiles, page layouts, and record types include certain fields? Uni
    14·1 answer
  • Which task is most suitable for creating an algorithm?
    15·2 answers
  • The internet shopping cart is an example of which version of the web?
    11·1 answer
  • What function key is used to enable the spelling and grammar function
    14·1 answer
  • B. What significant values have you learned while learning the tools and utensils?
    8·1 answer
  • What is a graphics card?
    5·1 answer
  • Write a C++ program to print name, age, class, school​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!