Hello, If anyone would be so kind as to help me out with a
solution in either Java or C++ please and thank you !!!
Java code for he above question is provided below. Please comment if any doubt.
DomainProgram.java
package domainprogram;
import java.util.Scanner;
public class DomainProgram {
public static void main(String[] args) {
int[] arr=new
int[10];
Scanner sc=new
Scanner(System.in);
// Read 10 integers to
array
System.out.print("Please
enter 10 different integers:");
for(int
i=0;i<10;i++)
{
arr[i]=sc.nextInt();
}
// a) For all x,
ifx<0 then x is even
boolean
result=true;
for(int
i=0;i<10;i++)
{
int x= arr[i];
// If first condition is false the result is true
// If first condition is true and the second condition is false it
return false
// If first condition is true and the second condition is also true
it return true
if(x<0)
{
if(x%2!=0)
{
result=false;
break;
}
}
}
if(result)
System.out.println("a) is True");
else
System.out.println("a) is False");
// b) There exist some x
such that, if x<0 then x is even
result=false;
for(int
i=0;i<10;i++)
{
int x= arr[i];
// if first condition is true
if(x<0)
{
// If second condition is also true
if(x%2==0)
{
result=true;
break;
}
}
// if first conditionis false
else
{
result=true;
break;
}
}
if(result)
System.out.println("b) is True");
else
System.out.println("b) is False");
// c) There exist some x
such that, x<0 and x is even
result=false;
for(int
i=0;i<10;i++)
{
int x= arr[i];
// Check both conditions are true
if(x<0 && (x%2==0))
{
result=true;
break;
}
}
if(result)
System.out.println("c) is True");
else
System.out.println("c) is False");
// d) For all x such
that, x is one more than multiple of three
// or x is of the form
one more than a multiple of two
result=true;
for(int
i=0;i<10;i++)
{
int x= arr[i];
// Check any of the condition is false
if((x%3!=1)&& (x%2!=1))
{
result=false;
break;
}
}
if(result)
System.out.println("d) is True");
else
System.out.println("d) is False");
}
}
Output:

Hello, If anyone would be so kind as to help me out with a solution in...
Simplify the following sentences in predicate logic so that all the negation symbols are directly in front of a predicate. (For example, Vx ((-0(x)) + (-E(x))) is simplified, because the negation symbols are direct in front of the predicates O and E. However, Væ -(P(2) V E(x)) is not simplified.) (i) -(3x (P(x) 1 (E(x) + S(x)))) (ii) -(Vx (E(x) V (P(x) +-(Sy G(x, y))))) Write a sentence in predicate logic (using the same predicates as above) which is true...
Answer the following questions in the space provided below. 1. For each proposition below, first determine its truth value, then negate the proposition and simplify (using DeMorgan's laws) to eliminate all – symbols. All variables are from the domain of integers. (a) 3x, 22 <2. (b) Vx, ((:22 = 0) + (x = 0)). (e) 3xWy((x > 0) (y > 0 + x Sy)). 2. Consider the predicates defined below. Take the domain to be the positive integers. P(x): x...
Hello; I would greatly appreciate your help with providing a solution to a problem that I'm having trouble with. Thank you! Write a program that reads a set of integers and then finds and prints the sum of the even and odd integers. The numbers will be read in from the user via the cin statement. You do not know how many numbers the user may enter. When the user enters a 0 (zero), then the user is done entering...
true and false propositions with quantifiers. Answer the following questions in the space provided below. 1. For each proposition below, first determine its truth value, then negate the proposition and simplify (using De Morgan's laws) to eliminate all – symbols. All variables are from the domain of integers. (a) 3.0, x2 <. (b) Vr, ((x2 = 0) + (0 = 0)). (c) 3. Vy (2 > 0) (y >0 <y)). 2. Consider the predicates defined below. Take the domain to...
in python and can you tell me why i am wrong? Thank you
ZyBooks Python M X zy cS 171: Computer x zy 11.9. LAB: Output x C Write A Program 1 x Slack | Hiu Nguy TG Python Program t x p ython - Getting x +. - 5 x € → e l earn.zybooks.com/zybook/DREXELCS171 Winter2020/chapter/11/section/9 Help/FAQ Kuanyu Lai - = zyBooks Bake My library > CS 171: Computer Programming home> > 11.9: LAB: Output values in a list...
Can anyone help me with rewriting my pseudocode? Below is the pseudocode, and after that is the completed program. Pseudocode: DISPLAY Login information PROMPT for username/password output "Enter Username" input userName output "Enter password: " input password //If successful, display information pertaining to the specific user, as well as prompt for logout IF User type 'quit' Exit Program VALIDATE User Credentials IF NOT Validated Check number of Invalid Attempts IF user attempts equal three THEN DISPLAY error message...
please
there are some specific instructions on the question so i would
greatly appreciate if they are followed . thank you very much for
your time
This lab covers: arrays functions input exception handling Question 1 The purpose of this question is to write a python program (script) that manipulates arrays using vector arithmetic. You will compute the values of points The ellipse has a major axis whose length is a and a minor axis whose length is b. For...
How would I make it so these are dialog boxes instead of just like a regular question? Here are the instructions. "Ask the user to input a number. You must use an input dialog box for this input. Be sure to convert the String from the dialog box into an integer (int). The program needs to keep track of the smallest number the user entered as well as the largest number entered. Use a Confirm dialog box to ask the user...
Hello Sir, I need help with Java. Here is the problem below. Problem 1.Write a program that prompts the user to enter the number of milliseconds and converts the milliseconds to a string hours:minutes:seconds. The program should use the convertMillismethod with the following header: public static String convertMillis(long millis) For example, convertMillis(5500) returns the string 0:0:5, convertMillis(100000) returns the string 0:1:40, and convertMillis(555550000) returns the string 154:19:10. Problem 2. (Count occurrence of numbers)Write a program that reads integers between 1...
Write a program to compute the product of two positive integers by repeated addition. Note: You are not allowed to use either multiplication or division operator. Understanding the Meaning of Multiplication: Multiplication of whole numbers can be thought of as repeated addition. // not allowed to use multiplication or division operator For example, suppose that a parking lot has 6 rows of parking spaces with 8 spaces in each row. How many parking spaces are in the lot? rows To...