By the due date assigned , read the description of the Eliza program at the bott
ID: 3749037 • Letter: B
Question
By the due date assigned, read the description of the Eliza program at the bottom of this question. Is it ethical to make people think they are talking to another person when they are not? Does it make a difference if they find the program to be helpful? Would you mind if a Help facility for some software you were using was a machine instead of a person? Have you ever been embarrassed when you thought you were talking to a person but later found out you were not? (For example, have you ever started to respond on the phone only to realize you were listening to an answering machine?)
import javax.swing.*;
public class Eliza
{
public static void main(String[] args)
{
String user;
String msg = "";
String msg1 = "Tell me more about your ";
String msg2 = "You seem to have strong feelings about that";
String msg3 = "Please go on";
String msg4 = "Tell me more";
String msg5 = "Continue";
int random;
int length;
int x, y;
int stopWord;
final String END = "Goodbye";
boolean foundMy = false, foundLove = false, foundHate = false;
user = JOptionPane.showInputDialog(null,
"Hello. I am Eliza, your tharapist. Tell me what" +
" is troubling you. Any time you want to quit," +
" just type "Goodbye"");
while(!user.equalsIgnoreCase(END))
{
user = user.toLowerCase();
length = user.length();
foundMy = false;
for(x = 0; x < length - 3; ++x) // If "my" is at end of sentence, no need to go further
{
if(user.charAt(x) == 'm')
{
if(user.charAt(x + 1) == 'y')
if(user.charAt(x + 2) == ' ')
if(x >= 1)
{
if(user.charAt(x - 1) == ' ')
foundMy = true;
}
else
foundMy = true;
}
if(foundMy)
{
stopWord = length;
for(y = x + 3; y < length; ++y)
{
if(user.charAt(y) == ' ' || user.charAt(y) == '.' || user.charAt(y) == ',')
stopWord = y;
}
msg = msg1 + user.substring(x + 3, stopWord);
x = length; // do not look for possible second "my"
}
}
if(!foundMy)
{
foundLove = false;
for(x = 0; x < length - 5; ++x)
{
if(user.charAt(x) == 'l')
{
if(user.charAt(x + 1) == 'o')
if(user.charAt(x + 2) == 'v')
if(user.charAt(x + 3) == 'e')
if(user.charAt(x + 4) == ' ')
if(x >= 1)
{
if(user.charAt(x - 1) == ' ')
foundLove = true;
}
else
foundLove = true;
}
if(foundLove)
{
msg = msg2;
x = length; // do not look for possible second "love"
}
}
}
if(!foundLove && !foundMy)
{
foundHate = false;
for(x = 0; x < length - 5; ++x)
{
if(user.charAt(x) == 'h')
{
if(user.charAt(x + 1) == 'a')
if(user.charAt(x + 2) == 't')
if(user.charAt(x + 3) == 'e')
if(user.charAt(x + 4) == ' ')
if(x >= 1)
{
if(user.charAt(x - 1) == ' ')
foundHate = true;
}
else
foundHate = true;
}
if(foundHate)
{
msg = msg2;
x = length; // do not look for possible second "hate"
}
}
}
if(!foundHate && !foundLove && !foundMy)
{
random = (int) (Math.random() * 100) % 3;
if(random == 0)
msg = msg3;
else
if(random == 1)
msg = msg4;
else
msg = msg5;
}
user = JOptionPane.showInputDialog(null, msg);
}
JOptionPane.showMessageDialog(null, END);
}
}
Explanation / Answer
Hi, Kindly check your answer and give the value able feedback for the solution and also give like if you like my answer -
All the 4 questions that you were asked above is been answered respectively -
1. As per my perspective, it is ethical to make people think they are talking to another person when they are not. Because it will help them out in their activity. Recently due to growing research in the technology, there comes new thing in the market called Internet Of Things. So here the smart devices which help people out in there day to day activity which is actually the really cool thing. So thinking like talking to another person when they are not it always useful in the decision making due to growing technology. These smart devices support us in making moral decisions, our right, and responsibilities etc.
2. It will definitely make a huge difference if people find the program to be helpful for them because it will give birth to the automation and it will do people work automatically and will save their time required for the day to day activity or the longtime activity.
3. No, I don't mind if a Help facility for some software I was using was a machine instead of a person. Because this anyway help people out in no time and with the help of the artificial intelligence and the automation in the industry this things can be put up to the next level. Also, it will be helpful where lots of repetition in the work required which can be achieved via. automated stuff.
4. Yes, sometimes I get embarrassed when I thought I were talking to a person but later found out you were not. This happens when we need things to be get done in no time and was expecting to get it resolved faster. For eg. when we call customer care then some automated voice scripts run and if we are in hurry then we might get embarrassed due to the time required to transfer the call to customer care executive.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.