Professional Documents
Culture Documents
CTOOD-final Report
CTOOD-final Report
(Deemed to be University)
FRESHMAN ENGINEERING DEPARTMENT
A Project Based Lab Report
On
PRODUCT SURVEY
SUBMITTED BY:
ID.no: Name:
2300032650 G. Jyothirmayee
Assistant Professor,CSE.
KL UNIVERSITY
Green fields, Vaddeswaram – 522 502
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES-1
CERTIFICATE
It is great pleasure for us to express our gratitude to our honorable President Sri.
Koneru Satyanarayana, for giving the opportunity and platform with facilities in
accomplishing the project-based laboratory report.
We express the sincere gratitude to our director Dr. A Jagadeesh for his
administration towards our academic growth.
We express sincere gratitude to our Coordinator Dr. M. Siva Ganga Prasad and
HOD-BES1Dr. D.Haritha for her leadership and constant motivation provided in
successful completion of our academic semester. We record it as our privilege to deeply
thank for providing us the efficient faculty and facilities to make our ideas into reality.
We express our sincere thanks to our project supervisor Mrs.G.Rajini Reddy for
her novel association of ideas, encouragement, appreciation, and intellectual zeal which
motivated us to venture this project successfully.
2300032650 G.Jyothirmayee
For each model, users can select whether they consider it to be good or bad based
on their personal experiences or preferences. The program records these ratings and
stores them for analysis. To ensure robustness and reliability of the rankings, Product
Survey requires input from at least five users for each model.
After collecting opinions from five users for all models within a category, Product
Survey compiles the data and calculates the overall ratings for each model. It then
generates a ranked list, showcasing the most preferred products at the top and the least
preferred ones at the bottom. These rankings provide valuable insights into consumer
preferences within each category.
1 Introduction 1
4 Class Diagram 4
5 Algorithm 5
6 Implementation 6
8 Conclusion 17
INTRODUCTION
Concepts:
GUI:
In Java applications, the components that comprise a GUI (Graphical User Interface)
are stored in containers called forms. The Java language provides a set of user interface
components from which GUI forms can be built.
The input is the data that we give to the program. The output is the data what we
receive from the program in the form of result.
ActionListener Interface:
Implementing this interface to handle user interactions with GUI components (e.g.,
button clicks triggering survey responses).
1
AIM
Advantages:-
1. A user-friendly interface as it has a graphic and intuitive way for the user to take
part in the survey, automated data collection it makes the surveyor’s work easier
and easy to analyze.
2. Real-time feedback enables the user view response in terms of the ranking
according to collected data.
3. Scalable extensive to include more products on the category without any changes
in logic.
4. It has educational values, a practical instance for learning how to design a GUI and
handling data in Java.
Disadvantages:-
1. The survey can potentially capture only binary feedback: Good/Bad, which may
not reflect the users’ true opinions .
2. The results can be highly biased based on the small number of users and their
preferences.
3. Ranking the products purely by user ratings can lead to oversimplified product
performance evaluation.
4. One must additionally acquire knowledge of Java GUI frameworks, which can
complicate the application’s further development and support.
Future Enhancements:-
2
SYSTEM REQUIREMENTS
SOFTWARE REQUIREMENTS:
The major software requirements of the project are as follows:
Language : JAVA
Operating System: Windows Xp or later.
HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as follows:
3
CLASS DIAGRAM
4
ALGORITHM
1.Initialization:
2.Adding Components:
i. Add a title label with a large font size to emphasize the purpose of the survey.
ii. Add a category label and a combo box for selecting the product category (e.g.,
AC, Mobile Phone, Laptop).
iii. Add a model label and a combo box that dynamically changes based on the
selected category.
iv. Add a submit button to submit the survey.
3.Populating Models:
4.Survey Submission:
i. Implement the action Performed method to handle the submit button click
event.
ii. Retrieve the selected model from the model combo box.
iii. Prompt the user to input their rating for the selected model (Good/Bad).
iv. Validate the input rating and update the ratings map accordingly.
5
IMPLEMENTATION
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
public SurveyProgram() {
setTitle("Welcome");
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.add(imageLabel, BorderLayout.CENTER);
6
accessButton.setBackground(Color.WHITE);
accessButton.addActionListener(e -> {
surveyFrame.setVisible(true);
dispose();
});
panel.add(accessButton, BorderLayout.SOUTH);
add(panel);
SwingUtilities.invokeLater(() -> {
mainFrame.setVisible(true);
});
7
private HashMap<String, String[]> modelsMap;
public SurveyFrame() {
setTitle("Product Survey");
setSize(600, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setBackground(Color.YELLOW);
initializeSurvey();
setLayout(new GridBagLayout());
gbc.fill = GridBagConstraints.HORIZONTAL;
gbc.gridx = 0;
gbc.gridy = 0;
8
gbc.gridwidth = 2;
gbc.anchor = GridBagConstraints.CENTER;
add(titleLabel, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
gbc.gridwidth = 1;
gbc.anchor = GridBagConstraints.LINE_END;
gbc.gridx = 1;
gbc.anchor = GridBagConstraints.LINE_START;
add(categoryComboBox, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
gbc.anchor = GridBagConstraints.LINE_END;
gbc.gridx = 1;
9
gbc.anchor = GridBagConstraints.LINE_START;
add(modelComboBox, gbc);
gbc.gridx = 0;
gbc.gridy = 3;
gbc.gridwidth = 2;
gbc.anchor = GridBagConstraints.CENTER;
submitButton.setBackground(Color.RED);
submitButton.addActionListener(this);
add(submitButton, gbc);
10
categoryComboBox.addActionListener(new ActionListener() {
@Override
modelComboBox.removeAllItems();
modelComboBox.addItem(model);
});
@Override
if (rating.equalsIgnoreCase("good")) {
11
currentRating++;
} else {
currentRating--;
ratingsMap.put(selectedModel, currentRating);
displayThankYouFrame();
} else {
thankYouFrame.setVisible(true);
public ThankYouFrame() {
setTitle("Thank You");
12
setSize(400, 300);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.add(imageLabel, BorderLayout.CENTER);
thankYouButton.setBackground(Color.WHITE);
panel.add(thankYouButton, BorderLayout.SOUTH);
add(panel);
13
INTEGRATION AND SYSTEM TESTING
OUTPUT:
Screen Shots:
14
15
16
CONCLUSION
The program then collects the ratings of five users for each model in the
survey and compiles a final ranking for each model within every product
category. This allows users to make an informed decision about selecting the
best product among all the models. The final rankings of each model are
presented to the user in a clear and concise manner, enabling them to easily
decipher which options are the most suitable for their specific needs.
Overall, this program is a valuable resource for conducting product surveys
and making well-informed purchasing decisions.
17