using System; 2 using UserNamespace; // namespace 3 4 5 namespace UserNamespace 6 + { 7 8 9 // User class definition public abstract class User { // instance variables private string user_id; // user id protected string user_password; // user password // parametrized constructor public User (string id, string pass) { user_id = id; user_password = pass; } // verifyLogin method to verify the login cresentials public bool verifyLogin(string id, string pass) { // return true, if matches // otherwise, return false return user_id.Equals(id)&&user_password. Equals(pass); } // abstract method public abstract void updatePassword(string newPassword); // Administrator clas definition public class Administrator: User { // instance variable private string admin_name; // name of admin // parametrized constructor public Administrator (string name, string id, string pass):base (id, pass) admin_name = name; 38 } 39 // updatePassword method to update the password of user public override void updatePassword (string newPassword) 40 41- { 42 user_password = newPassword; 43 } // updateAdminName method to update the name of the admin public void updateAdminName(string name) 45 46- { 47 admin_name = name; 48 } 49 50 51 // Testing class definition 52 public class Testing 53- 54 // main method 55 public static void Main() 56 { 57 // create an object of Administrator class 58 Administrator a = new Administrator ("Katty","kat123","katty123!"); // print the result 59 50 Console.WriteLine(a.verifyLogin("kat123","katty123!")); 51 52 10 11 12 13 14 15- 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36- 37
using System; 2 using UserNamespace; // namespace 3 4 5 namespace UserNamespace 6 + { 7 8 9 // User class definition public abstract class User { // instance variables private string user_id; // user id protected string user_password; // user password // parametrized constructor public User (string id, string pass) { user_id = id; user_password = pass; } // verifyLogin method to verify the login cresentials public bool verifyLogin(string id, string pass) { // return true, if matches // otherwise, return false return user_id.Equals(id)&&user_password. Equals(pass); } // abstract method public abstract void updatePassword(string newPassword); // Administrator clas definition public class Administrator: User { // instance variable private string admin_name; // name of admin // parametrized constructor public Administrator (string name, string id, string pass):base (id, pass) admin_name = name; 38 } 39 // updatePassword method to update the password of user public override void updatePassword (string newPassword) 40 41- { 42 user_password = newPassword; 43 } // updateAdminName method to update the name of the admin public void updateAdminName(string name) 45 46- { 47 admin_name = name; 48 } 49 50 51 // Testing class definition 52 public class Testing 53- 54 // main method 55 public static void Main() 56 { 57 // create an object of Administrator class 58 Administrator a = new Administrator ("Katty","kat123","katty123!"); // print the result 59 50 Console.WriteLine(a.verifyLogin("kat123","katty123!")); 51 52 10 11 12 13 14 15- 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36- 37
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
Can you please fix the code ? see picture for error thank you

Transcribed Image Text:Result
CPU Time: 0.02 sec(s), Memory: 16348 kilobyte(s)
Compilation succeeded - 1 warning(s)
True
jdoodle.cs(33,24): warning CS0414: The private field `UserNamespace. Administrator.admin_name' is assigned but its value is never used

Transcribed Image Text:1 using System;
2 using UserNamespace;
// namespace
3
4
5 namespace UserNamespace
6 {
7
8
Nm tin c
LO CO
9 ▾
10
11
12
13
14
15
16
17
18
19
20
21 -
22
23
24
25
26
27
28
29
30
31 ▾
32
33
34
35
36 -
37
38
39
40
41-
42
43
44
45
46 -
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// User class definition
public abstract class User
{
// instance variables
private string user_id; // user id
protected string user_password; // user password
// parametrized constructor
public User(string id, string pass)
{
user_id = id;
user_password = pass;
}
// verifyLogin method to verify the login cresentials
public bool verifyLogin(string id, string pass)
{
// return true, if matches
// otherwise, return false
return user_id.Equals(id)&&user_password. Equals(pass);
// abstract method
public abstract void updatePassword (string newPassword);
}
// Administrator clas definition
public class Administrator: User
// instance variable
private string admin_name; // name of admin
// parametrized constructor
public Administrator (string name, string id, string pass):base(id, pass)
{
admin_name = name;
}
// updatePassword method to update the password of user
public override void updatePassword(string newPassword)
{
user_password = newPassword;
}
// updateAdminName method to update the name of the admin
public void updateAdminName(string name)
admin_name name;
}
}
// Testing class definition
public class Testing
// main method
public static void Main()
// create an object of Administrator class
Administrator a = new Administrator ("Katty","kat123","katty123!");
// print the result
Console.WriteLine(a.verifyLogin("kat123","katty123!"));
}
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education