Java实现一个模型、两个视图和两个控制器的功能软件,即采用MVC模式或者说是观察者模式,本程序通过输入球体半径,显示球体形状,面积体积等Sphere.javapackageModel;importjava.util.Observable;publicclassSphereextendsObservable{ privatedoubleradius;//球体半径 privatedoublearea;//球体面积 privatedoublevolume;//球体体积 publicSphere() { radius=100d; area=4*Math.PI*Math.pow(radius,2); volume=4*Math.PI*Math.pow(radius,3)/3; } publicdoublegetRadius() { returnradius; } publicdoublegetArea() { returnarea; } publicdoublegetVolume() { returnvolume; } publicvoidsetRadius(doubleradius) { this.radius=radius; this.area=4*Math.PI*Math.pow(radius,2); this.volume=4*Math.PI*Math.pow(radius,3)/3; this.setChanged(); this.notifyObservers(); } }textView.javapackageView;importjava.util.Observer;importjava.util.Observable;importjava.text.NumberFormat;importjavax.swing.*;importController.TextController;importModel.Sphere;importjava.awt.*;importjava.awt.event.*;publicclassTextViewextendsJPanelimplementsObserver{ privateJLabelradiusLab;//提示用户输入球体半径 privateJTextFieldradiusTextField;//接受用户输入球体半径 //privateJLabelradiusRang; privateJLabelareaLab;//显示球体面积 privateJTextFieldareaTextField;//显示输入球体半径对应的面积 privateJLabelvolumeLab;//显示球体体积 privateJTextFieldvolumeTextField;//显示输入球体半径对应的体积 public TextView() { try{ Init(); } catch(Exceptione){ e.printStackTrace(); } } privatevoidInit()throwsException{ radiusLab=newJLabel("球体半径");radiusLab.setForeground(newColor(0,165,168));//radiusRang=newJLabel("[0-200]"); radiusTextField=newJTextField(12); radiusTextField.setForeground(newColor(223,100,158)); radiusTextField.setBackground(newColor(210,204,230)); areaLab=newJLabel("球体面积"); areaLab.setForeground(newColor(0,165,168)); areaTextField=newJTextField(12); areaTextField.setBackground(newColor(193,219,219)); areaTextField.setEditable(fal
1
数值分析颜庆津课件和matlab程序-《数值分析(颜庆津)》课件和matlab程序2.rar研究生数值分析课件和matlab程序,颜庆津版本,只能上传小于4M的文件,分两次上传。
(这两天在论坛里下了很多matlab有用的资料,谢谢math老师和各位大侠的辛苦分享。
)《数值分析(颜庆津)》课件和matlab程序1.rar数值分析课件和matlab程序1《数值分析(颜庆津)》课件和matlab程序2.rar数值分析课件和matlab程序2
2025/12/13 17:29:15 3.22MB matlab
1
#include"stdio.h";#include"graphics.h"#include"math.h"#include"dos.h"typedefstructPoint
2025/12/5 3:18:50 6KB 魔方
1
三角函数包括反三角函数的实现,基本思想是利用泰勒级数。
鉴于反三角函数ACOS在0.9-1的时候利用直接利用泰勒级数时收敛很慢的缺点,比较ulicx作了优化,使得精度和时间都达到了自己预期。
适用于在嵌入式环境下不好实用math库的项目
2025/11/28 15:16:33 188KB 三角函数 C语言 泰勒级数
1
例子开始吧./gradlewcleanbuildjava-jar./build/libs/math-0.0.1-SNAPSHOT.jar跑步./gradlewcleanbootRunDocker构建sudodockerlogin--usernameunclesaniasudodockerbuild-tunclesania/exampler:latest.sudodockerpushunclesania/exampler:latestDocker运行sudodockerrun--nameexampler-d--rm-p80:8080-p443:8443-itunclesania/exampler:latest创建自签证书创建PKCS12密钥库keytool-genkeypair-alia
2025/11/23 2:03:02 102KB Java
1
math-master:一个可刺激大脑进行快速计算的Android应用程序存储库
2025/5/4 20:56:15 143KB Java
1
Math-Pari-2.030518
2025/4/25 17:43:09 227KB Math-Pari-2.0305
1
第6章解决“实用C编程”第6章中的练习练习6-1:编写一个程序来查找两个之间的距离的平方点。
(对于更高级的问题,请找到实际距离。
此问题涉及使用标准功能sqrt。
请使用您的帮助系统来查找有关如何使用此功能的更多信息。
)#include#include<math.h>intmain(){ floatx1,y1,x2,y2,gdistance; printf("Inputx1:"); scanf("%f",&x1); printf("Inputy1:"); scanf("%f",&y1);printf("Inputx2:"); scanf("%f",&x2); printf("Inputy2:");
2025/4/3 11:14:32 1KB
1
优化设计鲍威尔法c#程序实例,优化设计大作业#include"stdio.h"#include"stdlib.h"#include"math.h"doubleobjf(doublex[]){doubleff;ff=x[0]*x[0]+x[1]*x[1]-x[0]*x[1]-10*x[0]-4*x[1]+60;return(ff)
1
实现了简单的监控视屏分屏浏览技术//////计算视频面板位置和面积/////////总面积和坐标///privateIListCalcPanelRectangle(intchannelCount,SizeTotalArea){IListresult=newList();//模数intmodulo;if(channelCount64)modulo=8;elsemodulo=(int)Math.Ceiling(Math.Sqrt(channelCount));//平方根intwidth,height;//单个画面大小width=(TotalArea.Width-modulo*1)/modulo;height=(TotalArea.Height-modulo*1)/modulo;for(inti=0;i<channelCount;i++){Rectanglerect=newRectangle();//AxDICOMax.AxDICOMXrect=newAxDICOMax.AxDICOMX();rect.Width=width;rect.Height=height;if(i%modulo==0){rect.X=1;if(i==0)rect.Y=1;elserect.Y=result[i-modulo].Y+height+1;}else{rect.X=result[i-1].X+width+1;rect.Y=result[i-1].Y;}result.Add(rect);}returnresult;}
2025/3/30 3:54:42 35KB C# Panel
1
共 48 条记录 首页 上一页 下一页 尾页
在日常工作中,钉钉打卡成了我生活中不可或缺的一部分。然而,有时候这个看似简单的任务却给我带来了不少烦恼。 每天早晚,我总是得牢记打开钉钉应用,点击"工作台",再找到"考勤打卡"进行签到。有时候因为工作忙碌,会忘记打卡,导致考勤异常,影响当月的工作评价。而且,由于我使用的是苹果手机,有时候系统更新后,钉钉的某些功能会出现异常,使得打卡变得更加麻烦。 另外,我的家人使用的是安卓手机,他们也经常抱怨钉钉打卡的繁琐。尤其是对于那些不太熟悉手机操作的长辈来说,每次打卡都是一次挑战。他们总是担心自己会操作失误,导致打卡失败。 为了解决这些烦恼,我开始思考是否可以通过编写一个全自动化脚本来实现钉钉打卡。经过一段时间的摸索和学习,我终于成功编写出了一个适用于苹果和安卓系统的钉钉打卡脚本。
2024-04-09 15:03 15KB 钉钉 钉钉打卡