8. frmCustomerList.add(customerList);
frmCustomerList.setVisible(true);
}
public void calculateArea() {
// Area = length x width
int length, width, area;
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if (b != null) {
floorType = b.getActionCommand();
}
try {
length = Integer.parseInt(lengthTextField.getText());
width = Integer.parseInt(widthTextField.getText());
area = length * width;
areaTextField.setText(String.valueOf(area) + " ft2");
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter
valid Length and width of floor");
return;
}
}
public void calculateCost() {
// Area = length x width
int length, width, area;
// Get type of the floor
ButtonModel b = btngroup.getSelection();
9. if (b != null) {
floorType = b.getActionCommand();
}
try {
length = Integer.parseInt(lengthTextField.getText());
width = Integer.parseInt(widthTextField.getText());
area = length * width;
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "Please enter
valid Length and width of floor");
return;
}
if (floorType.isEmpty()) {
JOptionPane.showMessageDialog(null, "Select type of
flooring");
} else {
if (floorType.equalsIgnoreCase("Wood")) {
cost = area * 20;
costTextField.setText("$" + String.valueOf(area *
20));
//area*20
} else {
cost = area * 10;
costTextField.setText("$" + String.valueOf(area *
10));
//area*10
}
}
}
public JPanel customerTab() {
JPanel panel = new JPanel();
10. panel.setLayout(new BoxLayout(panel,
BoxLayout.Y_AXIS));
panel.add(new JLabel("Welcome to Flooring
Application"));
panel.add(new JLabel("Customer Name: "));
nameTextField = new JTextField(15);
panel.add(nameTextField);
panel.add(new JLabel("Customer Address: "));
addressTextField = new JTextField(15);
panel.add(addressTextField);
panel.add(new JLabel(" "));
panel.add(new JLabel(" "));
return panel;
}
public JPanel floorTab() {
JPanel panel = new JPanel();
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel2.setLayout(new BorderLayout());
panel.setLayout(new FlowLayout());
panel1.setLayout(new GridLayout(0, 2));
panel2.add(panel, BorderLayout.CENTER);
panel2.add(panel1, BorderLayout.NORTH);
panel.add(new JLabel("Flooring Type? ",
JLabel.CENTER));
JRadioButton smallOption = new JRadioButton("Wood");
smallOption.setSelected(true);
smallOption.setActionCommand("Wood");
JRadioButton mediumOption = new
JRadioButton("Carpet");
mediumOption.setActionCommand("Carpet");
11. btngroup.add(smallOption);
btngroup.add(mediumOption);
panel.add(smallOption);
panel.add(mediumOption);
return panel2;
}
public JPanel floorDimensionsTab() {
JPanel panel = new JPanel();
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel2.setLayout(new BorderLayout());
panel.setLayout(new FlowLayout());
panel1.setLayout(new GridLayout(0, 2));
panel2.add(panel1, BorderLayout.NORTH);
panel1.add(new JLabel("Floor Length: "));
lengthTextField = new JTextField(15);
panel1.add(lengthTextField);
panel1.add(new JLabel("Floor Width: "));
widthTextField = new JTextField(15);
panel1.add(widthTextField);
return panel2;
}
public JPanel calculateTab() {
JPanel panel = new JPanel();
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel.setLayout(new BorderLayout());
14. public void addComponentsToPane(java.awt.Container);
public void actionPerformed(java.awt.event.ActionEvent);
publicstatic java.sql.Connection getConnection();
public void submitOrders();
public void viewCustomerList();
public void calculateArea();
public void calculateCost();
public javax.swing.JPanel customerTab();
public javax.swing.JPanel floorTab();
public javax.swing.JPanel floorDimensionsTab();
public javax.swing.JPanel calculateTab();
public javax.swing.JPanel summaryTab();
publicstatic void main(String[]);
}
CIS355A_StudentName_CourseProject/Flooring.javaCIS355A_
StudentName_CourseProject/Flooring.java/*****************
*****************************************************
*
Program Name: Flooring.java
Programmer's Name: Sarabjit Singh
Program Description: This program is a tabbed layout form with
flooring inputs
and connects to mysql database to insert and display records.
*****************************************************
******************/
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
19. // Get type of the floor
ButtonModel b = btngroup.getSelection();
if(b !=null){
floorType = b.getActionCommand();
}
if(nameTextField.getText().isEmpty()|| addressTextField.getTex
t().isEmpty()){
JOptionPane.showMessageDialog(null,"Input name and address
of the customer");
return;
}
if(floorType.isEmpty()){
JOptionPane.showMessageDialog(null,"Select type of flooring")
;
return;
}
try{
length =Integer.parseInt(lengthTextField.getText());
width =Integer.parseInt(widthTextField.getText());
area = length * width;
//areaTextField.setText(String.valueOf(area) + " ft2");
}catch(NumberFormatException e){
JOptionPane.showMessageDialog(null,"Please enter valid Lengt
h and width of floor");
return;
}
calculateArea();
Connection conn = getConnection();
try{
String sql ="INSERT INTO Flooring "
21. }catch(SQLException e){
// TODO Auto-generated catch block
e.printStackTrace();
}
frmCustomerList.add(customerList);
frmCustomerList.setVisible(true);
}
publicvoid calculateArea(){
// Area = length x width
int length, width, area;
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if(b !=null){
floorType = b.getActionCommand();
}
try{
length =Integer.parseInt(lengthTextField.getText());
width =Integer.parseInt(widthTextField.getText());
area = length * width;
areaTextField.setText(String.valueOf(area)+" ft2");
}catch(NumberFormatException e){
JOptionPane.showMessageDialog(null,"Please enter valid Lengt
h and width of floor");
return;
}
}
publicvoid calculateCost(){
22. // Area = length x width
int length, width, area;
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if(b !=null){
floorType = b.getActionCommand();
}
try{
length =Integer.parseInt(lengthTextField.getText());
width =Integer.parseInt(widthTextField.getText());
area = length * width;
}catch(NumberFormatException e){
JOptionPane.showMessageDialog(null,"Please enter valid Lengt
h and width of floor");
return;
}
if(floorType.isEmpty()){
JOptionPane.showMessageDialog(null,"Select type of flooring")
;
}else{
if(floorType.equalsIgnoreCase("Wood")){
cost = area *20;
costTextField.setText("$"+String.valueOf(area *20));
//area*20
}else{
cost = area *10;
costTextField.setText("$"+String.valueOf(area *10));
//area*10
}
}
}
23. publicJPanel customerTab(){
JPanel panel =newJPanel();
panel.setLayout(newBoxLayout(panel,BoxLayout.Y_AXIS
));
panel.add(newJLabel("Welcome to Flooring Application"))
;
panel.add(newJLabel("Customer Name: "));
nameTextField =newJTextField(15);
panel.add(nameTextField);
panel.add(newJLabel("Customer Address: "));
addressTextField =newJTextField(15);
panel.add(addressTextField);
panel.add(newJLabel(" "));
panel.add(newJLabel(" "));
return panel;
}
publicJPanel floorTab(){
JPanel panel =newJPanel();
JPanel panel1 =newJPanel();
JPanel panel2 =newJPanel();
panel2.setLayout(newBorderLayout());
panel.setLayout(newFlowLayout());
panel1.setLayout(newGridLayout(0,2));
Q1...Identify the most accurate sentential counterpart to the
natural language proposition
"If Smith increases enrollment, then both Baylor and Rice do
not raise tuition."
S = “Smith increases enrollment”; B = “Baylor raises tuition”;
R = “Rice raises tuition”
24. Select one:
a.
S → (∼B • ∼R)
b.
(∼B • ∼R) ∨ S
c.
(∼B • ∼R) → S
d.
S → ∼(B • R)
e.
∼ (B • R) → S
Question 2
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"Either Redbook increases circulation or both Glamour hires
models and Cosmo raises its price."
R = “Redbook increases circulation”; G = “Glamour hires
models”; C = “Cosmo raises its price”
Select one:
a.
R ∨ G • C
b.
R → (G • C)
c.
R • (G ∨ C)
d.
(G • C) → R
e.
R ∨ (G • C)
Question 3
Not yet answered
Marked out of 0.35
25. Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If Time expands coverage, then neither Money hires new
writers nor Forbes solicits new advertisers."
T = “Time expands coverage”; M = “Money hires new writers”;
F = “Forbes solicits new advertisers”
Select one:
a.
T → (∼M ∨ F)
b.
T → ∼ (M ∨ F)
c.
T → (∼M ∨ ∼F)
d. T → ∼(M • F)
e. ∼ (M ∨ F) → T
Question 4
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If People raises its price, then either Time expands coverage or
Newsweek does not increase circulation."
P = “People raises its prices”; T = “Time expands coverage”; N
= “Newsweek increases circulation”
Select one:
a. P → T ∨ ∼N
b.
(P → T) ∨ ∼N
c. (T ∨ ∼N) → P
d.
P → (T ∨ ∼N)
e.
26. P → (T ∨ N)
Question 5
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"Either Safeco reduces premiums and Geico cuts costs or
Farmers hires agents."
S = “Safeco reduces premiums”; G = “Geico cuts costs”; F =
“Farmers hires agents”
Select one:
a. S • (G ∨ F)
b. (S • G) → F
c.
(S • G) ∨ F
d. (S ∨ G) • F
e.
S ∨ (G • F)
Question 6
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If Liberty opens new offices, then not both Travelers and
Conseco run an ad."
L = “Liberty opens new offices”; T = “Travelers runs an ad; C =
“Conseco runs an ad”
Select one:
a. L → ∼ (T • C)
b. ∼ [C • (L → C)]
c.
L → (∼T • ∼C)
27. d.
∼ (T • C) → L
e.
(∼T • ∼C) → L
Question 7
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If neither Safeco cuts costs nor Travelers runs an ad, then
Progressive increases its territory."
S = “Safeco cuts costs”; T = “Travelers runs an ad”; P =
“Progressive increases its territory”
Select one:
a. ∼ (S ∨ T) → P
b.
P → (∼S ∨ ∼T)
c.
(∼S ∨ ∼T) → P
d.
(S ∨ T) → P
e. P → ∼(S ∨ T)
Question 8
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If either Nationwide or Geico does not open new offices, then
Metropolitan does not hire agents."
N = “Nationwide opens new offices”; G = “Geico opens new
offices”; M = “Metropolitan hires agents”
Select one:
28. a.
(∼N ∨ ∼G) → ∼M
b.
(∼N • ∼G) → ∼M
c.
∼ (N ∨ G) → ∼M
d.
∼N ∨ (∼G → ∼M)
e.
∼[ (N ∨ G) → M]
Question 9
Not yet answered
Marked out of 0.35
Flag question
Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If Progressive expands coverage then both Liberty and
Conseco do not cut costs."
P = “Progressive expands coverage”; L = “Liberty cuts costs”;
C = “Conseco cuts costs”
Select one:
a.
(∼L • ∼C) → P
b.
P → (∼L • ∼C)
c.
P → ∼ (L • C)
d.
P → (∼L ∨ ∼C)
e.
P → (L • ∼C)
Question 10
Not yet answered
Marked out of 0.35
Flag question
29. Question text
Identify the most accurate sentential counterpart to the natural
language proposition.
"If either Farmers runs an ad or Nationwide cuts costs, then if
Safeco expands coverage then Geico pays a dividend."
F = “Farmers run an ad”; N = “Nationwide cuts costs”; S =
“Safeco expands coverage”; G = “Geico pays dividends”
Select one:
a.
(F ∨ N) → (G → S)
b.
[F → (S → G)] ∨ [N → (S → G)]
c.
[(F ∨ N) → S] → G
d.
(F ∨ N) → (S → G)
e.
F ∨ [N → (S → G)]
Question 11
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. H → ∼ M
2. M
3. ∼ H
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
30. g. affirming the consequent
h. denying the antecedent
Question 12
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. ∼ D → N
2. D
3. ∼N
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 13
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. ∼ S
2. ∼ S → F
3. F
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
31. e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 14
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. S ∨ ∼T
2. ∼ S
3. ∼ T
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 15
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. ∼J → C
2. C → ∼T
3. ∼J → ∼T
Select one:
a. modus ponens
b. modus tollens
32. c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive syllogism
g. affirming the consequent
h. denying the antecedent
Question 16
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. L
2. ∼N → L
3. ∼N
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 17
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. G ∨ ∼T
2. (G → ∼H) • (∼T → A)
3. ∼H ∨ A
Select one:
a. modus ponens
33. b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 18
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. K ∨ ∼B
2. B
3. K
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 19
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. [P ∨ (D → T)] → ∼ (C • R)
2. [P ∨ (D → T)]
3. ∼ (C • R)
34. Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism
d. hypothetical syllogism
e. constructive dilemma
f. destructive dilemma
g. affirming the consequent
h. denying the antecedent
Question 20
Not yet answered
Marked out of 0.40
Flag question
Question text
Determine the argument form below:
1. (T → W) → [K • (E → Q)]
2. ∼ [K • (E → Q)]
3. ∼ (T → W)
Select one:
a. modus ponens
b. modus tollens
c. disjunctive syllogism