当前位置:首页 » 网购平台 » Java购物平台实验报告
扩展阅读
宁波奥德赛优惠价格 2021-03-15 14:26:02
丹尼斯购物卡能挂失么 2021-03-15 14:25:58
淘宝购物指纹验证失败 2021-03-15 14:24:44

Java购物平台实验报告

发布时间: 2021-03-04 13:19:29

① java编写简单购物系统

package cn.job01;
import java.util.Scanner;
public class Lx07 {
public static void choice() {
System.out.println("登陆菜单 ");
System.out.println("1登陆系统");
System.out.println("2退出");
}
static void choice1() {
System.out.println("购物管理系统>客户信息");
System.out.println("1显示所有客户信息");
System.out.println("2添加客户信息");
System.out.println("3修改客户信息");
System.out.println("4查询客户信息");
}
static void choice2() {
System.out.println("购物管理系统>真情回馈");
System.out.println("1幸运大放送");
System.out.println("2幸运抽奖");
System.out.println("3生日问候");
}
public static void main(String[] args) {
choice();
Scanner input = new Scanner(System.in);
System.out.println("请输入1or2");
int num = input.nextInt();
switch (num) {
case 1:
System.out.println("主菜单");
System.out.println("1客户信息管理");
System.out.println("2购物结算");
System.out.println("3真情回馈");
System.out.println("4注销");
break;
}
System.out.println("选择输入数字");
int num1 = input.nextInt();
switch (num1) {
case 1:
choice1();
break;
case 2:
System.out.println("购物结算");
break;
case 3:
choice2();
break;
case 4:
choice();
break;
}
}
}

② java实验报告实验过程和步骤怎么写

public interface Auth {

public void check(String name,String pwd,AuthResult result);

}

class AuthResult{

public String msg;// 结果信息
public boolean success;// 验证结果

public boolean isSuccess(){
return success;
}

public String getMsg(){
return msg;
}

}
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Auth1 implements Auth {

Map<String, String> data = new HashMap<String, String>();

@Override
public void check(String name,String pwd,AuthResult result) {
try {
// 加载用户名和密码
InputStream in = getClass().getResourceAsStream("Auth1.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String temp = null;
while((temp = br.readLine()) != null){
data.put(temp.split(":")[0], temp.split(":")[1]);
}
if(data.get(name) == null){
result.success = false;
result.msg = "用户名错误";
return;
}
if(!pwd.equals(data.get(name))){
result.success = false;
result.msg = "密码错误";
return;
}
result.success = true;
result.msg = "auth success!";
} catch (Exception e) {
e.printStackTrace();
}
}

}
public class Auth2 implements Auth {

Map<String, String> data = new HashMap<String, String>();

@Override
public void check(String name,String pwd,AuthResult result) {
try {
// 加载用户名和密码
InputStream in = getClass().getResourceAsStream("Auth2.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String temp = null;
int i = 1;
String temp1 = null;
while((temp = br.readLine()) != null){
if(i % 2 == 0){
data.put(temp1, temp);
} else {
temp1 = temp;
}
i++;
}
if(data.get(name) == null){
result.success = false;
result.msg = "用户名错误";
return;
}
if(!pwd.equals(data.get(name))){
result.success = false;
result.msg = "密码错误";
return;
}
result.success = true;
result.msg = "auth success!";
} catch (Exception e) {
e.printStackTrace();
}
}

}
import java.util.Scanner;

public class Test {
public static void main(String[] args) {
Auth1 a1 = new Auth1();
Auth2 a2 = new Auth2();
Scanner sc = new Scanner(System.in);
String name = null;
String pwd = null;
System.out.println("enter name:");
name = sc.nextLine();
System.out.println("enter pwd:");
pwd = sc.nextLine();
AuthResult result = new AuthResult();
System.out.println("---Auth1---check");
a1.check(name,pwd,result);
if(result.isSuccess()){
System.out.println("auth success!");
} else {
System.out.println("auth fail! because " + result.getMsg());
}
System.out.println("---Auth2---check");
a2.check(name,pwd,result = new AuthResult());
if(result.isSuccess()){
System.out.println("auth success!");
} else {
System.out.println("auth fail! because " + result.getMsg());
}
}
}
文件与这些类同包下应该就能读到
Auth1.txt
name1:pwd1
name2:pwd2
Auth2.txt
name3
pwd3
name4
pwd4

③ 跪求用java编写的购物网站

你需要做什么;这个很大的项目的不仅仅是前台网站,还有后台管理平台,还有甚至是客户端、wap页面。你具体些吧!

④ java实验报告怎么写

实验报告什么的我从来都是抄的
把实验要求写上去比如说:
熟悉并掌握拓扑排序什么的,
然后写预计结果最后把实现代码写上去就好了

⑤ 我想要JAVA实验报告

我给你啊

⑥ 急求一篇电子商务概论课程网上购物实验报告

网上购物来交流http://www.wh6.cn/index.php
淘宝里的自故事,诚信防骗居,购物技巧,经验...等等.

多看看这里的信息....你要的这里基本上都有.

⑦ java实验报告程序

publicinterfaceAuth{

publicvoidcheck(Stringname,Stringpwd,AuthResultresult);

}

classAuthResult{

publicStringmsg;//结果信息
publicbooleansuccess;//验证结果

publicbooleanisSuccess(){
s;
}

publicStringgetMsg(){
returnmsg;
}

}
importjava.io.BufferedReader;
importjava.io.InputStream;
importjava.io.InputStreamReader;
importjava.util.HashMap;
importjava.util.Map;

{

Map<String,String>data=newHashMap<String,String>();

@Override
publicvoidcheck(Stringname,Stringpwd,AuthResultresult){
try{
//加载用户名和密码
InputStreamin=getClass().getResourceAsStream("Auth1.txt");
BufferedReaderbr=newBufferedReader(newInputStreamReader(in));
Stringtemp=null;
while((temp=br.readLine())!=null){
data.put(temp.split(":")[0],temp.split(":")[1]);
}
if(data.get(name)==null){
result.success=false;
result.msg="用户名错误";
return;
}
if(!pwd.equals(data.get(name))){
result.success=false;
result.msg="密码错误";
return;
}
result.success=true;
result.msg="authsuccess!";
}catch(Exceptione){
e.printStackTrace();
}
}

}
{

Map<String,String>data=newHashMap<String,String>();

@Override
publicvoidcheck(Stringname,Stringpwd,AuthResultresult){
try{
//加载用户名和密码
InputStreamin=getClass().getResourceAsStream("Auth2.txt");
BufferedReaderbr=newBufferedReader(newInputStreamReader(in));
Stringtemp=null;
inti=1;
Stringtemp1=null;
while((temp=br.readLine())!=null){
if(i%2==0){
data.put(temp1,temp);
}else{
temp1=temp;
}
i++;
}
if(data.get(name)==null){
result.success=false;
result.msg="用户名错误";
return;
}
if(!pwd.equals(data.get(name))){
result.success=false;
result.msg="密码错误";
return;
}
result.success=true;
result.msg="authsuccess!";
}catch(Exceptione){
e.printStackTrace();
}
}

}
importjava.util.Scanner;

publicclassTest{
publicstaticvoidmain(String[]args){
Auth1a1=newAuth1();
Auth2a2=newAuth2();
Scannersc=newScanner(System.in);
Stringname=null;
Stringpwd=null;
System.out.println("entername:");
name=sc.nextLine();
System.out.println("enterpwd:");
pwd=sc.nextLine();
AuthResultresult=newAuthResult();
System.out.println("---Auth1---check");
a1.check(name,pwd,result);
if(result.isSuccess()){
System.out.println("authsuccess!");
}else{
System.out.println("authfail!because"+result.getMsg());
}
System.out.println("---Auth2---check");
a2.check(name,pwd,result=newAuthResult());
if(result.isSuccess()){
System.out.println("authsuccess!");
}else{
System.out.println("authfail!because"+result.getMsg());
}
}
}
文件与这些类同包下应该就能读到
Auth1.txt
name1:pwd1
name2:pwd2
Auth2.txt
name3
pwd3
name4
pwd4