SlideShare a Scribd company logo
1 of 34
CIS355A_StudentName_CourseProject/CIS355A Week 7 Course
Project.docxCIS355A Week 7 Course Project
Source Code
/****************************************************
*******************
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;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
@SuppressWarnings("serial")
public class Flooring extends JFrame implements
ActionListener {
JTextField nameTextField, addressTextField,
lengthTextField, widthTextField, areaTextField, costTextField;
// Text fields
JButton calculateAreaButton = new JButton("Calculate
Area"); // Calculate Area Button
JButton calculateCostButton = new JButton("Calculate
Cost"); // Calculate Cost Button
JButton submitButton = new JButton("Submit Order"); //
Submit Button
JButton summaryButton = new JButton("Display Order
Summary"); // Summary Button
JButton ShowListButton = new JButton("Display Order
List"); // Summary Button
ButtonGroup btngroup = new ButtonGroup();
JTextArea summaryTextArea = new JTextArea(5, 25); //
dispay summary
JTextArea customerList = new JTextArea(10, 25); // dispay
summary
JFrame frmCustomerList;
String floorType = "";
int cost;
Flooring() {
super("Flooring Application");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addComponentsToPane(getContentPane());
setSize(350, 200);
//pack();
setVisible(true);
}
public void addComponentsToPane(Container contentPane) {
JTabbedPane tabbedPane = new JTabbedPane();
// Add customer tab to the frame
JPanel customerPanel = customerTab();
tabbedPane.addTab("Customer", customerPanel);
// Add flooring tab to the frame
JPanel floorPanel = floorTab();
tabbedPane.addTab("Flooring", floorPanel);
// Add flooring tab to the frame
JPanel floorAreaPanel = floorDimensionsTab();
tabbedPane.addTab("Floor Area", floorAreaPanel);
// Add calculate tab to the frame
JPanel calculatePanel = calculateTab();
tabbedPane.addTab("Calculate", calculatePanel);
add(tabbedPane);
}
@Override
public void actionPerformed(ActionEvent e) {
String action = e.getActionCommand();
if (action.equalsIgnoreCase("Calculate Area")) {
calculateArea();
}
if (action.equalsIgnoreCase("Calculate Cost")) {
calculateCost();
}
if (action.equalsIgnoreCase("Submit Order")) {
submitOrders();
}
if (action.equalsIgnoreCase("Display Order List")) {
viewCustomerList();
}
if(action.equalsIgnoreCase("Display Order Summary")){
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if (b != null) {
floorType = b.getActionCommand();
}
String result = "Customer name: " +
nameTextField.getText() + "nCustomer Address: " +
addressTextField.getText() + "nFlooring Type: " + floorType +
"nFloor Length: " + lengthTextField.getText() + " ft" +
"nFloor Width: " + widthTextField.getText() + " ft" +
"nFlooring Cost: " + costTextField.getText() + "nFlooring
Area: " + areaTextField.getText();
summaryTextArea.setText(result);
JOptionPane.showMessageDialog(null,
summaryTextArea,"Summary",1);
}
}
// JDBC driver name and database URL
static final String JDBC_DRIVER =
"com.mysql.jdbc.Driver";
static final String DB_URL =
"jdbc:mysql://localhost/cis355?useSSL=false";
/**
* Create a database connection
*/
public static Connection getConnection() {
// Database credentials
Connection conn = null;
try {
conn =
DriverManager.getConnection(DB_URL,"root","password");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
public void submitOrders() {
int length, width, area;
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if (b != null) {
floorType = b.getActionCommand();
}
if (nameTextField.getText().isEmpty() ||
addressTextField.getText().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 Length and width of floor");
return;
}
calculateArea();
Connection conn = getConnection();
try {
String sql = "INSERT INTO Flooring "
+ "VALUES ('" + nameTextField.getText() + "', '"
+ addressTextField.getText() + "', '" + floorType + "','" + area +
"','" + cost + "')";
java.sql.PreparedStatement statement =
conn.prepareStatement(sql);
int result = statement.executeUpdate();
if(result >0)
JOptionPane.showMessageDialog(null,
"Order Added");
} catch (Exception se) {
se.printStackTrace();
}
}
public void viewCustomerList(){
frmCustomerList = new JFrame("Orders List");
frmCustomerList.setSize(new Dimension(700,500));
customerList = new JTextArea(6,2);
customerList.setEditable(false);
try {
Connection conn =
DriverManager.getConnection(DB_URL,"root","password");
String strSQl = "select * from flooring";
java.sql.PreparedStatement statement =
conn.prepareStatement(strSQl);
ResultSet resultSet = statement.executeQuery();
String text="Customer NametCustomer
AddresstFlooring TypetFloor AreatFloor Costn";
while(resultSet.next()){
text += resultSet.getString(1)+"tt" +
resultSet.getString(2)+"tt" +resultSet.getString(3)+"t" +
resultSet.getDouble(4) +"t" + resultSet.getDouble(5) +"n";
}
customerList.setText(text);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
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();
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();
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");
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());
panel1.setLayout(new GridLayout(0, 2));
panel2.setLayout(new GridLayout(2,2));
panel1.add(new JLabel("Floor Area: "));
areaTextField = new JTextField(15);
panel1.add(areaTextField);
panel1.add(new JLabel("Flooring Cost: "));
costTextField = new JTextField(15);
panel1.add(costTextField);
panel2.add(calculateAreaButton);
panel2.add(calculateCostButton);
calculateAreaButton.addActionListener(this);
calculateCostButton.addActionListener(this);
panel2.add(submitButton);
submitButton.addActionListener(this);
summaryButton.addActionListener(this);
panel2.add(summaryButton);
panel.add(panel1, BorderLayout.NORTH);
panel.add(panel2, BorderLayout.WEST);
panel.add(ShowListButton,BorderLayout.SOUTH);
ShowListButton.addActionListener(this);
return panel;
}
public JPanel summaryTab() {
JPanel panel = new JPanel();
panel.add(summaryTextArea);
return panel;
}
public static void main(String[] args) {
@SuppressWarnings("unused")
Flooring floor = new Flooring();
}
}
Screenshots
CIS355A_StudentName_CourseProject/Flooring.classpublicsync
hronizedclass Flooring extends javax.swing.JFrame implements
java.awt.event.ActionListener {
javax.swing.JTextField nameTextField;
javax.swing.JTextField addressTextField;
javax.swing.JTextField lengthTextField;
javax.swing.JTextField widthTextField;
javax.swing.JTextField areaTextField;
javax.swing.JTextField costTextField;
javax.swing.JButton calculateAreaButton;
javax.swing.JButton calculateCostButton;
javax.swing.JButton submitButton;
javax.swing.JButton summaryButton;
javax.swing.JButton ShowListButton;
javax.swing.ButtonGroup btngroup;
javax.swing.JTextArea summaryTextArea;
javax.swing.JTextArea customerList;
javax.swing.JFrame frmCustomerList;
String floorType;
int cost;
staticfinal String JDBC_DRIVER = com.mysql.jdbc.Driver;
staticfinal String DB_URL =
jdbc:mysql://localhost/cis355?useSSL=false;
void Flooring();
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;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JTabbedPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
@SuppressWarnings("serial")
publicclassFlooringextendsJFrameimplementsActionListener{
JTextField nameTextField, addressTextField, lengthTextField,
widthTextField, areaTextField, costTextField;// Text fields
JButton calculateAreaButton =newJButton("Calculate Area");//
Calculate Area Button
JButton calculateCostButton =newJButton("Calculate Cost");//
Calculate Cost Button
JButton submitButton =newJButton("Submit Order");// Submit
Button
JButton summaryButton =newJButton("Display Order Summary
");// Summary Button
JButtonShowListButton=newJButton("Display Order List");// S
ummary Button
ButtonGroup btngroup =newButtonGroup();
JTextArea summaryTextArea =newJTextArea(5,25);// dispay su
mmary
JTextArea customerList =newJTextArea(10,25);// dispay summa
ry
JFrame frmCustomerList;
String floorType ="";
int cost;
Flooring(){
super("Flooring Application");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addComponentsToPane(getContentPane());
setSize(350,200);
//pack();
setVisible(true);
}
publicvoid addComponentsToPane(Container contentPane){
JTabbedPane tabbedPane =newJTabbedPane();
// Add customer tab to the frame
JPanel customerPanel = customerTab();
tabbedPane.addTab("Customer", customerPanel);
// Add flooring tab to the frame
JPanel floorPanel = floorTab();
tabbedPane.addTab("Flooring", floorPanel);
// Add flooring tab to the frame
JPanel floorAreaPanel = floorDimensionsTab();
tabbedPane.addTab("Floor Area", floorAreaPanel);
// Add calculate tab to the frame
JPanel calculatePanel = calculateTab();
tabbedPane.addTab("Calculate", calculatePanel);
add(tabbedPane);
}
@Override
publicvoid actionPerformed(ActionEvent e){
String action = e.getActionCommand();
if(action.equalsIgnoreCase("Calculate Area")){
calculateArea();
}
if(action.equalsIgnoreCase("Calculate Cost")){
calculateCost();
}
if(action.equalsIgnoreCase("Submit Order")){
submitOrders();
}
if(action.equalsIgnoreCase("Display Order List")){
viewCustomerList();
}
if(action.equalsIgnoreCase("Display Order Summary")){
// Get type of the floor
ButtonModel b = btngroup.getSelection();
if(b !=null){
floorType = b.getActionCommand();
}
String result ="Customer name: "+ nameTextField.getText()+"n
Customer Address: "+ addressTextField.getText()+"nFlooring
Type: "+ floorType +"nFloor Length: "+ lengthTextField.getTe
xt()+" ft"+"nFloor Width: "+ widthTextField.getText()+" ft"+"
nFlooring Cost: "+ costTextField.getText()+"nFlooring Area: "
+ areaTextField.getText();
summaryTextArea.setText(result);
JOptionPane.showMessageDialog(null, summaryTextArea,"Sum
mary",1);
}
}
// JDBC driver name and database URL
staticfinalString JDBC_DRIVER ="com.mysql.jdbc.Driver";
staticfinalString DB_URL ="jdbc:mysql://localhost/cis355?useS
SL=false";
/**
* Create a database connection
*/
publicstaticConnection getConnection(){
// Database credentials
Connection conn =null;
try{
conn =DriverManager.getConnection(DB_URL,"root","
password");
}catch(SQLException e){
// TODO Auto-generated catch block
e.printStackTrace();
}
return conn;
}
publicvoid submitOrders(){
int length, width, area;
// 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 "
+"VALUES ('"+ nameTextField.getText()+"', '"+ addressTextFi
eld.getText()+"', '"+ floorType +"','"+ area +"','"+ cost +"')";
java.sql.PreparedStatement statement = conn.prepareSta
tement(sql);
int result = statement.executeUpdate();
if(result >0)
JOptionPane.showMessageDialog(null,"Order Added");
}catch(Exception se){
se.printStackTrace();
}
}
publicvoid viewCustomerList(){
frmCustomerList =newJFrame("Orders List");
frmCustomerList.setSize(newDimension(700,500));
customerList =newJTextArea(6,2);
customerList.setEditable(false);
try{
Connection conn =DriverManager.getConnection(DB_URL,"roo
t","password");
String strSQl ="select * from flooring";
java.sql.PreparedStatement statement = conn.prepareState
ment(strSQl);
ResultSet resultSet = statement.executeQuery();
String text="Customer NametCustomer AddresstFlooring Type
tFloor AreatFloor Costn";
while(resultSet.next()){
text += resultSet.getString(1)+"tt"+ resultSet.getStr
ing(2)+"tt"+resultSet.getString(3)+"t"+ resultSet.getDouble(4
)+"t"+ resultSet.getDouble(5)+"n";
}
customerList.setText(text);
}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(){
// 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
}
}
}
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”
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
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.
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)
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:
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
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
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
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
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
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)
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

More Related Content

Similar to CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx

Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsGraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsNeo4j
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdfherminaherman
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfaquadreammail
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniquesjoaopmaia
 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfstopgolook
 
Practical TypeScript
Practical TypeScriptPractical TypeScript
Practical TypeScriptldaws
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsAlfonso Peletier
 
DesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxDesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxMariusIoacara2
 
Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfmeerobertsonheyde608
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Tsuyoshi Yamamoto
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxikirkton
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfmalavshah9013
 

Similar to CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx (20)

Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & OperationsGraphTour - Utilizing Powerful Extensions for Analytics & Operations
GraphTour - Utilizing Powerful Extensions for Analytics & Operations
 
cypress.pdf
cypress.pdfcypress.pdf
cypress.pdf
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
Getting the following errorsError 1 error C2436 {ctor}  mem.pdfGetting the following errorsError 1 error C2436 {ctor}  mem.pdf
Getting the following errorsError 1 error C2436 {ctor} mem.pdf
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
 
operating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdfoperating system linux,ubuntu,Mac Geometri.pdf
operating system linux,ubuntu,Mac Geometri.pdf
 
SQLite Techniques
SQLite TechniquesSQLite Techniques
SQLite Techniques
 
Dojo and Adobe AIR
Dojo and Adobe AIRDojo and Adobe AIR
Dojo and Adobe AIR
 
in c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdfin c languageTo determine the maximum string length, we need to .pdf
in c languageTo determine the maximum string length, we need to .pdf
 
Practical TypeScript
Practical TypeScriptPractical TypeScript
Practical TypeScript
 
Final_Project
Final_ProjectFinal_Project
Final_Project
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
DesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptxDesignPatterns-IntroPresentation.pptx
DesignPatterns-IntroPresentation.pptx
 
Need help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdfNeed help on creating code using cart. The output has to show multip.pdf
Need help on creating code using cart. The output has to show multip.pdf
 
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
Grails 1.2 探検隊 -新たな聖杯をもとめて・・・-
 
this
thisthis
this
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docxbbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
bbyopenApp_Code.DS_StorebbyopenApp_CodeVBCodeGoogleMaps.docx
 
Create a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdfCreate a JAVA program that performs file IO and database interaction.pdf
Create a JAVA program that performs file IO and database interaction.pdf
 

More from clarebernice

Consider the vision for a successful Southwest Transit marketing tea.docx
Consider the vision for a successful Southwest Transit marketing tea.docxConsider the vision for a successful Southwest Transit marketing tea.docx
Consider the vision for a successful Southwest Transit marketing tea.docxclarebernice
 
Consider the various ways to create effective communication in teams.docx
Consider the various ways to create effective communication in teams.docxConsider the various ways to create effective communication in teams.docx
Consider the various ways to create effective communication in teams.docxclarebernice
 
consider the unique and varied forms of slaveryenslavement in Afric.docx
consider the unique and varied forms of slaveryenslavement in Afric.docxconsider the unique and varied forms of slaveryenslavement in Afric.docx
consider the unique and varied forms of slaveryenslavement in Afric.docxclarebernice
 
Consider the types of digital technology advances that exist and how.docx
Consider the types of digital technology advances that exist and how.docxConsider the types of digital technology advances that exist and how.docx
Consider the types of digital technology advances that exist and how.docxclarebernice
 
Consider the two following statements Photosynthesis and cellular .docx
Consider the two following statements Photosynthesis and cellular .docxConsider the two following statements Photosynthesis and cellular .docx
Consider the two following statements Photosynthesis and cellular .docxclarebernice
 
Consider the study on Ethnography you described last week, Remind us.docx
Consider the study on Ethnography you described last week, Remind us.docxConsider the study on Ethnography you described last week, Remind us.docx
Consider the study on Ethnography you described last week, Remind us.docxclarebernice
 
Consider the role of HR in a rapidly-changing world. What cha.docx
Consider the role of HR in a rapidly-changing world. What cha.docxConsider the role of HR in a rapidly-changing world. What cha.docx
Consider the role of HR in a rapidly-changing world. What cha.docxclarebernice
 
Consider the scenarios involving the unwilling moral agents of J.docx
Consider the scenarios involving the unwilling moral agents of J.docxConsider the scenarios involving the unwilling moral agents of J.docx
Consider the scenarios involving the unwilling moral agents of J.docxclarebernice
 
Consider the scenario below.A toxic waste dump company wants to .docx
Consider the scenario below.A toxic waste dump company wants to .docxConsider the scenario below.A toxic waste dump company wants to .docx
Consider the scenario below.A toxic waste dump company wants to .docxclarebernice
 
Consider the role of interest groups in the policy-making process, w.docx
Consider the role of interest groups in the policy-making process, w.docxConsider the role of interest groups in the policy-making process, w.docx
Consider the role of interest groups in the policy-making process, w.docxclarebernice
 
Consider the role of stakeholders in addressing a health problem a.docx
Consider the role of stakeholders in addressing a health problem a.docxConsider the role of stakeholders in addressing a health problem a.docx
Consider the role of stakeholders in addressing a health problem a.docxclarebernice
 
Consider the quote by Adam Fuss in this module in which he describes.docx
Consider the quote by Adam Fuss in this module in which he describes.docxConsider the quote by Adam Fuss in this module in which he describes.docx
Consider the quote by Adam Fuss in this module in which he describes.docxclarebernice
 
Consider the obstacles that Phoenix Jackson had to overcome on h.docx
Consider the obstacles that Phoenix Jackson had to overcome on h.docxConsider the obstacles that Phoenix Jackson had to overcome on h.docx
Consider the obstacles that Phoenix Jackson had to overcome on h.docxclarebernice
 
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docx
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docxConsider the nurse leader’s role in achieving the IHI Quadruple Ai.docx
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docxclarebernice
 
Consider the music business as a supply network. How has music d.docx
Consider the music business as a supply network. How has music d.docxConsider the music business as a supply network. How has music d.docx
Consider the music business as a supply network. How has music d.docxclarebernice
 
Consider the mean of a cluster of objects from a binary transact.docx
Consider the mean of a cluster of objects from a binary transact.docxConsider the mean of a cluster of objects from a binary transact.docx
Consider the mean of a cluster of objects from a binary transact.docxclarebernice
 
Consider the importance of using a variety of assessments in the.docx
Consider the importance of using a variety of assessments in the.docxConsider the importance of using a variety of assessments in the.docx
Consider the importance of using a variety of assessments in the.docxclarebernice
 
Consider the importance of visuals in connecting with an audienc.docx
Consider the importance of visuals in connecting with an audienc.docxConsider the importance of visuals in connecting with an audienc.docx
Consider the importance of visuals in connecting with an audienc.docxclarebernice
 
Consider the imagery you created in your mind as you interacted with.docx
Consider the imagery you created in your mind as you interacted with.docxConsider the imagery you created in your mind as you interacted with.docx
Consider the imagery you created in your mind as you interacted with.docxclarebernice
 
Consider the followingContrast Soviet and post-Soviet migration.docx
Consider the followingContrast Soviet and post-Soviet migration.docxConsider the followingContrast Soviet and post-Soviet migration.docx
Consider the followingContrast Soviet and post-Soviet migration.docxclarebernice
 

More from clarebernice (20)

Consider the vision for a successful Southwest Transit marketing tea.docx
Consider the vision for a successful Southwest Transit marketing tea.docxConsider the vision for a successful Southwest Transit marketing tea.docx
Consider the vision for a successful Southwest Transit marketing tea.docx
 
Consider the various ways to create effective communication in teams.docx
Consider the various ways to create effective communication in teams.docxConsider the various ways to create effective communication in teams.docx
Consider the various ways to create effective communication in teams.docx
 
consider the unique and varied forms of slaveryenslavement in Afric.docx
consider the unique and varied forms of slaveryenslavement in Afric.docxconsider the unique and varied forms of slaveryenslavement in Afric.docx
consider the unique and varied forms of slaveryenslavement in Afric.docx
 
Consider the types of digital technology advances that exist and how.docx
Consider the types of digital technology advances that exist and how.docxConsider the types of digital technology advances that exist and how.docx
Consider the types of digital technology advances that exist and how.docx
 
Consider the two following statements Photosynthesis and cellular .docx
Consider the two following statements Photosynthesis and cellular .docxConsider the two following statements Photosynthesis and cellular .docx
Consider the two following statements Photosynthesis and cellular .docx
 
Consider the study on Ethnography you described last week, Remind us.docx
Consider the study on Ethnography you described last week, Remind us.docxConsider the study on Ethnography you described last week, Remind us.docx
Consider the study on Ethnography you described last week, Remind us.docx
 
Consider the role of HR in a rapidly-changing world. What cha.docx
Consider the role of HR in a rapidly-changing world. What cha.docxConsider the role of HR in a rapidly-changing world. What cha.docx
Consider the role of HR in a rapidly-changing world. What cha.docx
 
Consider the scenarios involving the unwilling moral agents of J.docx
Consider the scenarios involving the unwilling moral agents of J.docxConsider the scenarios involving the unwilling moral agents of J.docx
Consider the scenarios involving the unwilling moral agents of J.docx
 
Consider the scenario below.A toxic waste dump company wants to .docx
Consider the scenario below.A toxic waste dump company wants to .docxConsider the scenario below.A toxic waste dump company wants to .docx
Consider the scenario below.A toxic waste dump company wants to .docx
 
Consider the role of interest groups in the policy-making process, w.docx
Consider the role of interest groups in the policy-making process, w.docxConsider the role of interest groups in the policy-making process, w.docx
Consider the role of interest groups in the policy-making process, w.docx
 
Consider the role of stakeholders in addressing a health problem a.docx
Consider the role of stakeholders in addressing a health problem a.docxConsider the role of stakeholders in addressing a health problem a.docx
Consider the role of stakeholders in addressing a health problem a.docx
 
Consider the quote by Adam Fuss in this module in which he describes.docx
Consider the quote by Adam Fuss in this module in which he describes.docxConsider the quote by Adam Fuss in this module in which he describes.docx
Consider the quote by Adam Fuss in this module in which he describes.docx
 
Consider the obstacles that Phoenix Jackson had to overcome on h.docx
Consider the obstacles that Phoenix Jackson had to overcome on h.docxConsider the obstacles that Phoenix Jackson had to overcome on h.docx
Consider the obstacles that Phoenix Jackson had to overcome on h.docx
 
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docx
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docxConsider the nurse leader’s role in achieving the IHI Quadruple Ai.docx
Consider the nurse leader’s role in achieving the IHI Quadruple Ai.docx
 
Consider the music business as a supply network. How has music d.docx
Consider the music business as a supply network. How has music d.docxConsider the music business as a supply network. How has music d.docx
Consider the music business as a supply network. How has music d.docx
 
Consider the mean of a cluster of objects from a binary transact.docx
Consider the mean of a cluster of objects from a binary transact.docxConsider the mean of a cluster of objects from a binary transact.docx
Consider the mean of a cluster of objects from a binary transact.docx
 
Consider the importance of using a variety of assessments in the.docx
Consider the importance of using a variety of assessments in the.docxConsider the importance of using a variety of assessments in the.docx
Consider the importance of using a variety of assessments in the.docx
 
Consider the importance of visuals in connecting with an audienc.docx
Consider the importance of visuals in connecting with an audienc.docxConsider the importance of visuals in connecting with an audienc.docx
Consider the importance of visuals in connecting with an audienc.docx
 
Consider the imagery you created in your mind as you interacted with.docx
Consider the imagery you created in your mind as you interacted with.docxConsider the imagery you created in your mind as you interacted with.docx
Consider the imagery you created in your mind as you interacted with.docx
 
Consider the followingContrast Soviet and post-Soviet migration.docx
Consider the followingContrast Soviet and post-Soviet migration.docxConsider the followingContrast Soviet and post-Soviet migration.docx
Consider the followingContrast Soviet and post-Soviet migration.docx
 

Recently uploaded

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Recently uploaded (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

CIS355A_StudentName_CourseProjectCIS355A Week 7 Course Project..docx

  • 1. CIS355A_StudentName_CourseProject/CIS355A Week 7 Course Project.docxCIS355A Week 7 Course Project Source Code /**************************************************** ******************* 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; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.ButtonModel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane;
  • 2. import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; @SuppressWarnings("serial") public class Flooring extends JFrame implements ActionListener { JTextField nameTextField, addressTextField, lengthTextField, widthTextField, areaTextField, costTextField; // Text fields JButton calculateAreaButton = new JButton("Calculate Area"); // Calculate Area Button JButton calculateCostButton = new JButton("Calculate Cost"); // Calculate Cost Button JButton submitButton = new JButton("Submit Order"); // Submit Button JButton summaryButton = new JButton("Display Order Summary"); // Summary Button JButton ShowListButton = new JButton("Display Order List"); // Summary Button ButtonGroup btngroup = new ButtonGroup(); JTextArea summaryTextArea = new JTextArea(5, 25); // dispay summary JTextArea customerList = new JTextArea(10, 25); // dispay summary JFrame frmCustomerList; String floorType = ""; int cost; Flooring() { super("Flooring Application"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); addComponentsToPane(getContentPane());
  • 3. setSize(350, 200); //pack(); setVisible(true); } public void addComponentsToPane(Container contentPane) { JTabbedPane tabbedPane = new JTabbedPane(); // Add customer tab to the frame JPanel customerPanel = customerTab(); tabbedPane.addTab("Customer", customerPanel); // Add flooring tab to the frame JPanel floorPanel = floorTab(); tabbedPane.addTab("Flooring", floorPanel); // Add flooring tab to the frame JPanel floorAreaPanel = floorDimensionsTab(); tabbedPane.addTab("Floor Area", floorAreaPanel); // Add calculate tab to the frame JPanel calculatePanel = calculateTab(); tabbedPane.addTab("Calculate", calculatePanel); add(tabbedPane); } @Override public void actionPerformed(ActionEvent e) { String action = e.getActionCommand(); if (action.equalsIgnoreCase("Calculate Area")) {
  • 4. calculateArea(); } if (action.equalsIgnoreCase("Calculate Cost")) { calculateCost(); } if (action.equalsIgnoreCase("Submit Order")) { submitOrders(); } if (action.equalsIgnoreCase("Display Order List")) { viewCustomerList(); } if(action.equalsIgnoreCase("Display Order Summary")){ // Get type of the floor ButtonModel b = btngroup.getSelection(); if (b != null) { floorType = b.getActionCommand(); } String result = "Customer name: " + nameTextField.getText() + "nCustomer Address: " + addressTextField.getText() + "nFlooring Type: " + floorType + "nFloor Length: " + lengthTextField.getText() + " ft" + "nFloor Width: " + widthTextField.getText() + " ft" + "nFlooring Cost: " + costTextField.getText() + "nFlooring Area: " + areaTextField.getText(); summaryTextArea.setText(result); JOptionPane.showMessageDialog(null, summaryTextArea,"Summary",1); }
  • 5. } // JDBC driver name and database URL static final String JDBC_DRIVER = "com.mysql.jdbc.Driver"; static final String DB_URL = "jdbc:mysql://localhost/cis355?useSSL=false"; /** * Create a database connection */ public static Connection getConnection() { // Database credentials Connection conn = null; try { conn = DriverManager.getConnection(DB_URL,"root","password"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return conn; } public void submitOrders() { int length, width, area; // Get type of the floor ButtonModel b = btngroup.getSelection(); if (b != null) { floorType = b.getActionCommand(); } if (nameTextField.getText().isEmpty() || addressTextField.getText().isEmpty()) {
  • 6. 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 Length and width of floor"); return; } calculateArea(); Connection conn = getConnection(); try { String sql = "INSERT INTO Flooring " + "VALUES ('" + nameTextField.getText() + "', '" + addressTextField.getText() + "', '" + floorType + "','" + area + "','" + cost + "')"; java.sql.PreparedStatement statement = conn.prepareStatement(sql); int result = statement.executeUpdate(); if(result >0)
  • 7. JOptionPane.showMessageDialog(null, "Order Added"); } catch (Exception se) { se.printStackTrace(); } } public void viewCustomerList(){ frmCustomerList = new JFrame("Orders List"); frmCustomerList.setSize(new Dimension(700,500)); customerList = new JTextArea(6,2); customerList.setEditable(false); try { Connection conn = DriverManager.getConnection(DB_URL,"root","password"); String strSQl = "select * from flooring"; java.sql.PreparedStatement statement = conn.prepareStatement(strSQl); ResultSet resultSet = statement.executeQuery(); String text="Customer NametCustomer AddresstFlooring TypetFloor AreatFloor Costn"; while(resultSet.next()){ text += resultSet.getString(1)+"tt" + resultSet.getString(2)+"tt" +resultSet.getString(3)+"t" + resultSet.getDouble(4) +"t" + resultSet.getDouble(5) +"n"; } customerList.setText(text); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); }
  • 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());
  • 12. panel1.setLayout(new GridLayout(0, 2)); panel2.setLayout(new GridLayout(2,2)); panel1.add(new JLabel("Floor Area: ")); areaTextField = new JTextField(15); panel1.add(areaTextField); panel1.add(new JLabel("Flooring Cost: ")); costTextField = new JTextField(15); panel1.add(costTextField); panel2.add(calculateAreaButton); panel2.add(calculateCostButton); calculateAreaButton.addActionListener(this); calculateCostButton.addActionListener(this); panel2.add(submitButton); submitButton.addActionListener(this); summaryButton.addActionListener(this); panel2.add(summaryButton); panel.add(panel1, BorderLayout.NORTH); panel.add(panel2, BorderLayout.WEST); panel.add(ShowListButton,BorderLayout.SOUTH); ShowListButton.addActionListener(this); return panel; } public JPanel summaryTab() { JPanel panel = new JPanel(); panel.add(summaryTextArea); return panel; } public static void main(String[] args) { @SuppressWarnings("unused") Flooring floor = new Flooring();
  • 13. } } Screenshots CIS355A_StudentName_CourseProject/Flooring.classpublicsync hronizedclass Flooring extends javax.swing.JFrame implements java.awt.event.ActionListener { javax.swing.JTextField nameTextField; javax.swing.JTextField addressTextField; javax.swing.JTextField lengthTextField; javax.swing.JTextField widthTextField; javax.swing.JTextField areaTextField; javax.swing.JTextField costTextField; javax.swing.JButton calculateAreaButton; javax.swing.JButton calculateCostButton; javax.swing.JButton submitButton; javax.swing.JButton summaryButton; javax.swing.JButton ShowListButton; javax.swing.ButtonGroup btngroup; javax.swing.JTextArea summaryTextArea; javax.swing.JTextArea customerList; javax.swing.JFrame frmCustomerList; String floorType; int cost; staticfinal String JDBC_DRIVER = com.mysql.jdbc.Driver; staticfinal String DB_URL = jdbc:mysql://localhost/cis355?useSSL=false; void Flooring();
  • 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;
  • 15. import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.ButtonModel; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import javax.swing.JTextField; @SuppressWarnings("serial") publicclassFlooringextendsJFrameimplementsActionListener{ JTextField nameTextField, addressTextField, lengthTextField, widthTextField, areaTextField, costTextField;// Text fields JButton calculateAreaButton =newJButton("Calculate Area");// Calculate Area Button JButton calculateCostButton =newJButton("Calculate Cost");// Calculate Cost Button JButton submitButton =newJButton("Submit Order");// Submit Button JButton summaryButton =newJButton("Display Order Summary ");// Summary Button JButtonShowListButton=newJButton("Display Order List");// S ummary Button ButtonGroup btngroup =newButtonGroup(); JTextArea summaryTextArea =newJTextArea(5,25);// dispay su mmary
  • 16. JTextArea customerList =newJTextArea(10,25);// dispay summa ry JFrame frmCustomerList; String floorType =""; int cost; Flooring(){ super("Flooring Application"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); addComponentsToPane(getContentPane()); setSize(350,200); //pack(); setVisible(true); } publicvoid addComponentsToPane(Container contentPane){ JTabbedPane tabbedPane =newJTabbedPane(); // Add customer tab to the frame JPanel customerPanel = customerTab(); tabbedPane.addTab("Customer", customerPanel); // Add flooring tab to the frame JPanel floorPanel = floorTab(); tabbedPane.addTab("Flooring", floorPanel); // Add flooring tab to the frame JPanel floorAreaPanel = floorDimensionsTab(); tabbedPane.addTab("Floor Area", floorAreaPanel); // Add calculate tab to the frame JPanel calculatePanel = calculateTab(); tabbedPane.addTab("Calculate", calculatePanel); add(tabbedPane);
  • 17. } @Override publicvoid actionPerformed(ActionEvent e){ String action = e.getActionCommand(); if(action.equalsIgnoreCase("Calculate Area")){ calculateArea(); } if(action.equalsIgnoreCase("Calculate Cost")){ calculateCost(); } if(action.equalsIgnoreCase("Submit Order")){ submitOrders(); } if(action.equalsIgnoreCase("Display Order List")){ viewCustomerList(); } if(action.equalsIgnoreCase("Display Order Summary")){ // Get type of the floor ButtonModel b = btngroup.getSelection(); if(b !=null){ floorType = b.getActionCommand(); } String result ="Customer name: "+ nameTextField.getText()+"n
  • 18. Customer Address: "+ addressTextField.getText()+"nFlooring Type: "+ floorType +"nFloor Length: "+ lengthTextField.getTe xt()+" ft"+"nFloor Width: "+ widthTextField.getText()+" ft"+" nFlooring Cost: "+ costTextField.getText()+"nFlooring Area: " + areaTextField.getText(); summaryTextArea.setText(result); JOptionPane.showMessageDialog(null, summaryTextArea,"Sum mary",1); } } // JDBC driver name and database URL staticfinalString JDBC_DRIVER ="com.mysql.jdbc.Driver"; staticfinalString DB_URL ="jdbc:mysql://localhost/cis355?useS SL=false"; /** * Create a database connection */ publicstaticConnection getConnection(){ // Database credentials Connection conn =null; try{ conn =DriverManager.getConnection(DB_URL,"root"," password"); }catch(SQLException e){ // TODO Auto-generated catch block e.printStackTrace(); } return conn; } publicvoid submitOrders(){ int length, width, area;
  • 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 "
  • 20. +"VALUES ('"+ nameTextField.getText()+"', '"+ addressTextFi eld.getText()+"', '"+ floorType +"','"+ area +"','"+ cost +"')"; java.sql.PreparedStatement statement = conn.prepareSta tement(sql); int result = statement.executeUpdate(); if(result >0) JOptionPane.showMessageDialog(null,"Order Added"); }catch(Exception se){ se.printStackTrace(); } } publicvoid viewCustomerList(){ frmCustomerList =newJFrame("Orders List"); frmCustomerList.setSize(newDimension(700,500)); customerList =newJTextArea(6,2); customerList.setEditable(false); try{ Connection conn =DriverManager.getConnection(DB_URL,"roo t","password"); String strSQl ="select * from flooring"; java.sql.PreparedStatement statement = conn.prepareState ment(strSQl); ResultSet resultSet = statement.executeQuery(); String text="Customer NametCustomer AddresstFlooring Type tFloor AreatFloor Costn"; while(resultSet.next()){ text += resultSet.getString(1)+"tt"+ resultSet.getStr ing(2)+"tt"+resultSet.getString(3)+"t"+ resultSet.getDouble(4 )+"t"+ resultSet.getDouble(5)+"n"; } customerList.setText(text);
  • 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