0. 目录
- 小超市例程
- Java 的世界是一个类和对象的世界
1. 小超市例程
- Java 就是使用类来描述世界,用类的实例(对象)让世界运转起来
- 各种操作数据的代码太乱了怎么办?
小超市需要:
-
超市名称
-
超市地址
-
停车位数量
-
收入总和
-
商品列表
-
商品名称
-
商品 id
-
商品库存
-
销售价格
-
进货成本「购买价格」
-
-
商品销售「销售数量」
-
客户
-
顾客名字
-
顾客带了多少钱
-
顾客是否开车过来
-
小超市需要:
超市名称
超市地址
停车位数量
收入总和
商品列表
商品名称
商品 id
商品库存
销售价格
进货成本「购买价格」
商品销售「销售数量」
客户
顾客名字
顾客带了多少钱
顾客是否开车过来
你好,我是悦创。
我们来系统学习 Java 中的 Random
类及其用法。Java 提供了 java.util.Random
类用于生成随机数,它是基础随机数生成工具之一。
在使用 Random
类之前,需要引入它:
import java.util.Random;
LAB #8 DUE DATE: WEEK 11
Rock-Paper-Scissors Part 2
Select appropriate control structures used to create games
Extend the functionality of the rock paper scissors game to include interactivity using JavaScript. Create an AI to make decisions for player 2, determine the winner after each round and allow the player with the best of five rounds to win the game.
In this experiment report, you'll complete two parts in order:
First, complete a coding task (i.e., House Prices Prediction), and write iPython/Jupyter code based on the tools provided. You'll submit your code as a ZIP to the email address below.
Second, write a report based on your experimental results. This report should include experimental complete analysis, including data processing, model training, test evaluation, and references. You'll submit this Word report separately. This report should be approximately 1000 +/- 10% words.
ASSIGNMENT #5
Title | Rock Paper Scissors – Part 1 |
---|---|
Learning objectives | JavaScript Functions |
Instructions | Lay the foundations for a rock paper scissors game by using html to place the selection buttons (for Rock, Paper, and Scissors) and an area for both player 1 and player 2’s choice to appear. Create functions for player 1 to make their choice of either Rock, Paper, or Scissors and have their area update accordingly. |
Deliverables | Functional webpage for the game with clean layout. Clean and readable code. Selection images for Rock, Paper, Scissors. Clicking on a selection image updates player 1’s choice. Reset Button to clear values to their starting state. |
Create a flowchart would allow a teacher to create a class list of student names stored in an array.
The teacher should be able to individually add each student's name, and indicate when they have finished.
At the end of the teacher's input, the program should print a list of all student's names in the class.
除了 String 是我们 Java 自带的类,其他的类都是我们自己创建的类。CPU、Memory、Storage。
接下来,我们用一个类来把上面串联起来。构成我们自己的手机:
/**
* @ClassName: MyPhoneMaker
* @Description: TODO
* @Author: AndersonHJB
* @date: 2022/11/22 23:08
* @Version: V1.0
* @Blog: https://bornforthis.cn
*/
public class MyPhoneMaker {
// 我的手机制造商
public static void main(String[] args) {
Phone phone = new Phone();
phone.hasFigurePrintUnlocker = true; // 指纹解锁器
phone.price = 1999; // 价格
phone.screen = new Screen(); // 屏幕
phone.screen.producer = "京东方"; // 屏幕生产商
phone.screen.size = 8.8; // 屏幕大小
CPU cpu = new CPU(); // CPU
cpu.producer = "三星"; // CPU 生产商
cpu.speed = 3.5; // CPU 速度
Memory memory = new Memory(); // 内存
memory.producer = "三星"; // 内存生产商
// memory.producer = new String("三星"); // 内存生产商,这么写没啥意义,因为双引号 Java就会自动识别字符串
memory.capacity = 4; // 容量
Storage storage = new Storage(); // 储存
storage.producer = "Intel"; // 储存生产商
storage.capacity = 128; // 容量
phone.mainboard = new Mainboard(); // 主板
phone.mainboard.cpu = cpu;
phone.mainboard.memory = memory;
phone.mainboard.storage = storage;
phone.mainboard.model = "EA888";
phone.mainboard.year = 2019;
// 想想我们创建了几个对象,有创建了几个引用?
// 有几个 new 就有几个对象
// 另外,还有 5个 string 对象
phone.prePhone = new Phone();
// 引用能互相用吗?
// Memory m1 = new Memory();
// Storage s1 = new Storage();
// Memory m2 = s1;
// Storage s2 = m1;
}
}
虾 | 龙口粉丝 | 蒜末 | 娃娃菜 | 金针菇 | 大葱 |
---|---|---|---|---|---|
生姜 | 小米椒 | 料酒 | 砂锅 |
All questions on this exam must be solved with a Probabilistic Programming Language (PPL);
Fall 2024 Final Exam Problem 1
The sinking of the Titanic is one of the most infamous shipwrecks in history. On April 15, 1912, during her maiden voyage, the widely considered “unsinkable” RMS Titanic sank after colliding with an iceberg. Unfortunately, there weren’t enough lifeboats for everyone onboard, resulting in the death of 1,502 out of 2,224 passengers and crew. While there was some element of luck involved in surviving, it seems some groups of people were more likely to survive than others.
课程论文内容为根据给定数据进行数据分析,对数据分析结果撰写数据分析报告。
数据集描述如下:
数据集是著名葡萄牙“Vinho Verde”葡萄酒的葡萄酒质量数据集,其中有红酒观测数据1599条,白葡萄酒观测数据4898条。数据中的输出变量是葡萄酒质量 quality。是一个从0(低质量)到10(高质量)的评分。输入变量是葡萄酒的物理化学成分和特性,包括非挥发性酸、挥发性酸、柠檬酸、残余糖分、氯化物、游离二氧化硫、总二氧化硫、密度、pH值、硫酸盐和酒精含量。
数据分析报告中要求报告的内容:
对数据集进行描述性分析,用直方图显示红葡萄酒和白葡萄酒质量的评分分布并进行文字汇报。
分析并汇报红葡萄酒和白葡萄酒的平均质量评分是否存在差别。
计算11个输入指标间的相关系数矩阵,汇报哪些变量与葡萄酒质量正相关,哪些是负相关。
分别随机抽取红葡萄酒和白葡萄酒的200条观测数据,以散点图的形式对比11个输入变量对葡萄酒质量的影响(两种酒放在一个图中方便对比,最好用带有回归线的散点图,这样对比更清楚)。对散点图进行分析。
自变量标准化以后使用最小二乘估计分别对两种葡萄酒的观测值进行多元线性回归,对回归结果进行解释和分析。
撰写数据分析报告总结。
数据分析python代码以附录的形式放在数据分析报告最后,代码要有代码标注(可以用Notebook文件转换成PDF文件附上)
香港理工大学计算机系模拟考试卷
What is the output of the following program?
str1 = "COMP1012"
print(str1[1:4], str1[:2], str1[2:], str1[0:-2], str1[:-1])
洋葱🧅 | 肥牛卷 | 西红柿 | 盐 | 糖 | 淀粉 |
---|---|---|---|---|---|
黑胡椒 | 生抽 | 老抽 | 蚝油 | 蕃茄酱 | 香油 |
蒜 | 香葱 | 糖心蛋(可选) |
LAB #6 DUE DATE: WEEK 9
Number Wizard Part 2
Select appropriate control structures used to create games
Extend the functionality from Number Wizard Part 1 to allow the wizard ito make the guesses. The wizard should guess a number between 1 and 100. The player will then indicate if the number is higher, lower, or correct.
Ancient Chinese artwork holds profound cultural and historical significance, reflecting the philosophical, spiritual, and aesthetic values of various dynasties. However, inferring the creation period of calligraphy and painting works remains a challenging task, primarily due to the subtle characteristics of works from different eras and variations in preservation conditions. In this competition, our goal is to leverage machine learning techniques to predict the dynasty of these artworks based on the scanned images.
[Fall 2024] Machine Learning Final Competition Guidelines
Version: November 27th, 2024
Ancient Chinese artwork holds profound cultural and historical significance, reflecting the philosophical, spiritual, and aesthetic values of various dynasties. However, inferring the creation period of calligraphy and painting works remains a challenging task, primarily due to the subtle characteristics of works from different eras and variations in preservation conditions. In this competition, our goal is to leverage machine learning techniques to predict the dynasty of these artworks based on the scanned images.