服务器负载测试帖

你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好你好

import java.text.NumberFormat;

public class Item

{

private String item;

private int quantity;

private double price;



public Item(String item, double price, int quantity)

{

    this.item = item;

    this.price=price;

    this.quantity=quantity;

}

public String getItem(){

    return item;

}

public double getPrice(){

    return price;

}

public int getQuantity(){

    return quantity;

}

public double getTot(){

    return price\*quantity;

}

public String toString()

{

    NumberFormat fmt = NumberFormat.getCurrencyInstance();



    String description;



    description = item + "\\t" + fmt.format(price) + "\\t" + quantity + "\\t";



    return description;

}

}

import java.text.NumberFormat;

public class ShoppingCart {

private Item\[\] cart;

private int itemCount;

private int capacity;

private double totalPrice = 0, q=0, p=0;

public ShoppingCart() {

    capacity = 100;

    cart = new Item\[capacity\];

    itemCount = 0;

}



public void addItem(String item, double price, int quantity) {

    if (itemCount == cart.length) {

        increaseSize();

    }

    cart\[itemCount\] = new Item(item, price, quantity);

    totalPrice+=price\*quantity;

    itemCount++;

}



public String toString() {

    NumberFormat fmt = NumberFormat.getCurrencyInstance();

    String report = "Shopping Cart\\n";

    report += "Item\\tUnit Price\\tQuantity\\tTotal\\n";



    for (int i = 0; i < itemCount; i++) {

        Item it = cart\[i\];

        report += it.getItem() + "\\t" + fmt.format(it.getPrice()) + "\\t" + it.getQuantity() + "\\t\\t" + fmt.format(it.getTot()) + "\\n";

    }



    report += "\\nTotal Price of cart: " + fmt.format(totalPrice);

    return report;

}



private void increaseSize() {

    Item\[\] temp = new Item\[cart.length + 3\];

    for (int i = 0; i < cart.length; i++) {

        temp\[i\] = cart\[i\];

    }

    cart = temp;

}

}

import java.util.Scanner;

public class Shop

{

public static void main(String\[\] args)

{

    ShoppingCart cart = new ShoppingCart();

    boolean shop=true;

    double price;

    String item=new String();

    int quantity;

    Scanner scan=new Scanner (System.in);

    while(shop){

        System.out.print("Item: ");

        item=scan.nextLine();

        System.out.print("Price: ");

        price=scan.nextDouble();

        scan.nextLine();

        System.out.print("Quantity: ");

        quantity=scan.nextInt();

        scan.nextLine();

        cart.addItem(item, price, quantity);

        System.out.println(cart.toString());

        System.out.print("Continue? (true/false)");

        shop=scan.nextBoolean();

        scan.nextLine();

    }

    System.out.println(cart.toString());

}

}

//Task 1

import java.util.Scanner;

public class weatherchecker{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter the temperature:");

    double t=scan.nextDouble();

    System.out.println("Please enter the weather:");

    String w=scan.nextLine();

    String Sunny="sunny";

    if(w.equals(Sunny)&&t>=20&&t<=30){

        System.out.println("Perfect day for a picnic!");

    }

    else{

        System.out.println("Not the best day for a picnic.");

    }

}

}

//Task 2

import java.util.Scanner;

public class stringcomparison{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter:");

    String t=scan.nextLine();

    String l=scan.nextLine();

    if(t.equals(l)){

        System.out.println("Strings are identical.");

    }

    else{

        System.out.println("Strings are different.");

    }

}

}

//Task 3

import java.util.Scanner;

public class movierecommendation{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter the type:");

    String t=scan.nextLine();

    String action="action movies";

    String comedies="comedies";

    System.out.println("Please enter the rating:");

    double r=scan.nextDouble();

    if(t.equals(action)&&r>8){

        System.out.println("Recommended.");

    }

    else if (t.equals(comedies)&&r<5){

        System.out.println("Try a different one.");

    }

    else{

        System.out.println("You can try this one as well.");

    }

}

}

//Task 4

import java.util.Scanner;

public class passwordchecker{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter the password:");

    String p=scan.nextLine();

    String up=p.toUpperCase();

    int in=p.indexOf("PASSWORD");

    if(p.length()<8||in>=0){

        System.out.println("Invalid password");

    }

    else{

        System.out.println("Password is valid");

    }

}

}

//Task 5

import java.util.Scanner;

public class discounteligibility{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter whether you are a member:");

    boolean Member=scan.nextBoolean();

    System.out.println("Please enter the money:");

    double m=scan.nextDouble();

    if(Member=true||m>=100){

        System.out.println("Eligible for discount.");

    }

    else{

        System.out.println("Not eligible for discount.");

    }

}

}

//Task 6

import java.util.Scanner;

public class comparingnumber{

public static void main (String args\[\]){

    Scanner scan=new Scanner (System.in);

    System.out.println("Please enter the first number:");

    int f=scan.nextInt();

    System.out.println("Please enter the second number:");

    int s=scan.nextInt();

    if(f==s){

        System.out.println("Numbers are equal.");

    }

    else if (f>s){

        System.out.println("First number is greater.");

    }

    else{

        System.out.println("Second number is greater.");

    }

}

}

:eye:

来凑热闹了

为啥只有你一个人发

By the time they graduate, Penn students are already making an impact on the world. Throughout your time here, you’ll have access to a wide range of resources to support your post-Penn goals and future career paths. Through career services and advising, we’re here to help you achieve all that you’re interested in after graduating.

Don’t believe us? Let the stats speak for themselves!
Class of 2025 Outcomes Within 6 Months of Graduation*

97%

OF PENN UNDERGRADUATES RECEIVE THEIR DIPLOMA WITHIN 6 YEARS

91%

ARE EMPLOYED FULL-TIME OR CONTINUING THEIR EDUCATION

$103,418

MEDIAN STARTING SALARY FOR 2025 GRADUATES EMPLOYED FULL-TIME

GRADUATES ARE EMPLOYED ALL OVER THE WORLD IN COUNTRIES INCLUDING CANADA, BOLIVIA, FRANCE, INDIA, SAUDIA ARABIA, CHINA AND MORE!

*For students whose outcomes are known to us.
All data sourced from University of Pennsylvania Career Services website.

Tips From Penn Admissions

The possibilities are truly endless after you graduate from Penn. Penn alumni go on to make an impact in the world in all areas—business, nonprofits, arts, healthcare, technology, education, and more! Many of our alumni attribute their success to the resources available during their time at Penn like individualized career advising, job and internship interview prep, and career fairs. No matter what your dreams are, Penn will give you the foundation to chase after them and thrive.

LEARN MORE ABOUT PENN’S POST-GRADUATE OUTCOMES >

Update your profile so we can send you the most accurate information and personalized invitations from Penn.


Follow @PreviewingPennPreviewingPenn on social media for more admissions tips, campus life, and student takeovers!

University of Pennsylvania • Philadelphia, PA

This email was sent to manlinlavender.fang@outlook.com by University of Pennsylvania Office of Admissions.
University of Pennsylvania Undergraduate Admissions, 3535 Market Street, Philadelphia, PA 19104
Unsubscribe from University of Pennsylvania Undergraduate Admissions.