Hot Search : Source embeded web remote control p2p game More...
Location : Home Search - c B
Search - c B - List
实验一:C++编程入门 1. 设计一个程序,其中实现两个函数,分别要求: 1. 解一元二次方程 求解一元二次方程Ax²+Bx+C=0的根。用户输入A、B、C的值,输出方程根x1和x2。(使用引用) 2. 求三角形面积 输入三角形的三边长a、b、c(边长可以是小数),求三角形面积area,并输出。如果输入的三边构不成三角形,应给出“data error”的信息提示。注:根据“海伦”公式,area*area=p(p-a)(p-b)(p-c),其中p=(a+b+c)/2。 2. 设计一个控制台程序,输入一个数组(长度不超过100)的值,求出各个值从小到大排序后的次序。 输入:输入的第一个数为数组的长度,后面的数为数组中的值,以空格分割; 输出:各输入的值按从小到大排列的次序号。 Sample Input: 4 -3 75 12 -3 Output: -3 -3 4 12 75 3. 设计一个学生类,管理以下信息:学号、姓名、出生日期(包括年月日)、性别、班级、成绩。该类有2个方法:readInfo用于读取其信息,disPlay用于打印信息。编写main函数测试这个学生类,要求输入并打印5个学生信息。 三、实验要求  将程序源代码压缩后提交至学院FTP上对应实验和班级的目录中。  作业命名方式为:“学号姓名.rar”。  作业提交时间:下次实验课前提交。
Date : 2011-08-18 Size : 7.2kb User : zhuchao0731@163.com

实验三:C++编程入门 一、实验内容 1. 类模版。 2. 运算符重载。 3. 友元。 4. 继承。 二、实验题目 1, 设计一个类SavingsAccount,定义一个静态数据成员记录存款的年利率(rate),该类的每个成员都包含一个私有的数据成员balance,表示该成员当前的存款数额。提供一个成员函数CalMonthlyInterest(),用以计算月利息(用balance乘以rate再除以12),并将这个月利息加入balance中。提供一个静态成员函数ModifyRate(),用以改变静态数据成员rate的值。定义两个不同的SavingsAccount对象saver1和saver2,当前存款数额balance分别为2000.00和3000.00。首先将rate设置为3%,计算每个存款人的月息并打印新的结果,然后将rate设置为4%,再次计算每个存款人的月息并打印新的结果。 2, 设计一个学生类student,包括学生学号、姓名、成绩;设计一个友元函数,比较某两个学生成绩的高低;读入一个文本文件(格式如示例studengt.txt,每行的学号、姓名、成绩之间用四个空格隔开)中所有学生的学号、姓名、成绩,输出最高成绩和最低成绩的学生信息(学号、姓名、成绩)。 3, 阅读下面例子,将题中的Time类声明为Data类的友元类,通过Time类中的display函数引用Data类的私有数据,输出年、月、日和时、分、秒。 #include <iostream> using namespace std; class Date; //对Date类的提前引用声明 class Time //定义Time类 { public: Time(int,int,int); void display(Date &); //display是成员函数,形参是Date类对象的引用 private: int hour; int minute; int sec; }; class Date //声明Date类 { public: Date(int,int,int); friend void Time∷display(Date &); //声明Time中的display函数为友元成员函数 private: int month; int day; int year; }; Time∷Time(int h,int m,int s) //类Time的构造函数 { hour=h; minute=m; sec=s; } void Time∷display(Date &d) //display的作用是输出年、月、日和时、分、秒 { cout<<d.month<<″/″<<d.day<<″/″<<d.year<<endl; //引用Date类对象中的私有数据 cout<<hour<<″:″<<minute<<″:″<<sec<<endl; //引用本类对象中的私有数据 } Date∷Date(int m,int d,int y) //类Date的构造函数 { month=m; day=d; year=y; } int main( ) { Time t1(10,13,56); //定义Time类对象t1 Date d1(12,25,2004); //定义Date类对象d1 t1.display(d1); //调用t1中的display函数,实参是Date类对象d1 return 0; } 4, 将下面程序改为在类模板外定义各成员函数: #include <iostream> using namespace std; template<class numtype> //定义类模板 class Compare { public: Compare(numtype a,numtype b) { x=a;y=b; } numtype max( ) { return (x>y)?x:y; } numtype min( ) { return (x<y)?x:y; } private: numtype x,y; }; int main( ) { Compare<int> cmp1(3,7); //定义对象cmp1,用于两个整数的比较 cout<<cmp1.max( )<<″ is the Maximum of two integer numbers.″<<endl; cout<<cmp1.min( )<<″ is the Minimum of two integer numbers.″<<endl<<endl; Compare<float> cmp2(45.78,93.6); //定义对象cmp2,用于两个浮点数的比较 cout<<cmp2.max( )<<″ is the Maximum of two float numbers.″<<endl; cout<<cmp2.min( )<<″ is the Minimum of two float numbers.″<<endl<<endl; Compare<char> cmp3(′a′,′A′); //定义对象cmp3,用于两个字符的比较 cout<<cmp3.max( )<<″ is the Maximum of two characters.″<<endl; cout<<cmp3.min( )<<″ is the Minimum of two characters.″<<endl; return 0; } 5, 有两个矩阵a和b,均为2行3列,求两个矩阵的和。重载运算符“+”使之用于矩阵相加。如:c=a+b。重载插入运算符“<<”和流提取运算符“>>”,使之能用于该矩阵的输入和输出。 6, 利用类继承分别完成一个学生类、一个大学生类、一个本科生类,本科生类中包括了一个学生作为他的班长。在创建一个本科生对象时赋予他的全部信息,输出该本科生对象的全部信息。 7, 利用c++继承、多态虚函数、构造函数完成以下程序:设计人、老师、学生、大学生、研究生、大四学生等类、其主要属性自己定义,要求包括以下方法: 1) 构造函数,创建对象的主要信息 2) Display,显示每种类对象的主要信息 此外,要求每个类包含一个生日对象,其类型为Birthday类,学生类应该包含一个班主任对象,其类型为老师类。 三、实验要求  将程序源代码压缩后提交至学院FTP上对应实验和班级的目录中。  作业命名方式为:“学号姓名.rar”。  作业提交时间:下次实验课前提交。
Date : 2011-08-18 Size : 1.2mb User : zhuchao0731@163.com

实验七:C++编程入门 一、实验内容 1. 理解继承与组合。 2. 学会使用多态特性。 3. 使用文件。 4. 异常处理。 二、实验题目 1. 创建一个class Counted,包含一个int类型的成员变量id和一个static int类型的成员变量count。默认构造函数的开头为“Counted() : id(count ++) {”。要求: a) 构造函数输出id值并且输出“it’s being created”; b) 析构函数也输出id值并且输出“it is being destroyed”; c) 使用new创建一个class Counted的对象,并且用delete销毁它; d) 使用new创建一个class Counted的对象数组,并且用delete[]销毁它; 2. 使用继承的方法,编写一个点类Point和线段类Line。要求:点以(x, y)的形式打印坐标的值;线段以上述形式打印两端点的坐标(x1, y1)、(x2,y2),并设计计算线段长度的内联函数。 3. 创建一个简单的Shape层次:基类称为Shape,派生类分别为Circle、Square和Triangle。在基类中定义一个虚函数draw(),然后再在这些派生类中定义这个函数。在堆中创建Shape对象,并建立一个指向这些Shape对象的指针数组(这样就形成了指针向上类型转换),通过基类指针调用draw(),检验虚函数的行为。 4. 利用c++继承、多态虚函数、构造函数完成以下程序:设计人、老师、学生、大学生、研究生、大四学生等类、其主要属性自己定义,要求包括以下方法: 1) 构造函数,创建对象的主要信息 2) Display,显示每种类对象的主要信息 此外,要求每个类包含一个生日对象,其类型为Birthday类,学生类应该包含一个班主任对象,其类型为老师类。 利用研究生类创建一个数组,来存储一个班级的学生信息,将其写入硬盘文件,再读出来进行显示。读写文件失败时要进行异常处理。 三、实验要求  将程序源代码压缩后提交至学院FTP上对应实验和班级的目录中。  作业命名方式为:“学号姓名.rar”。  作业提交时间:下次实验课前提交。
Date : 2011-08-18 Size : 9.45kb User : zhuchao0731@163.com

这是我自己用C++BUILDER做的一个定时关机的程序-This is for my own use C BUILDER do a regular shutdown procedures
Date : 2025-12-21 Size : 349kb User :

DL : 0
public class gedebahe { public static void main( String [] args) { for ( ) { int a=-1,b,c //b,c是分解出来的两个数 System.out.print("Please input a oushu:") //输入一个偶数 try { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) String inputLine = in.readLine() a = Integer.valueOf(inputLine).intValue() }catch (Exception exc) { System.out.println("Sorry,please input a number.") return } if (a%2!=0) { System.out.println("Sorry,please input a oushu.") return } for (b=1 b<a b++) { c=(a-b) if(isPrime(b)&&isPrime(c)) { System.out.println(a+"="+b+"+"+c) break } } } } public static boolean isPrime(int k)//方法用来判断一个数是否为偶数 { int a boolean t = true if (k==1) return t for (a=2 a<k a++) { if (k%a==0) break } if (a!=k) t=false return t-gedebahe public class (public static void main (String [] args) (for () (int a = a, b, c// b, c is the decomposition of the two several System.out.print ( "Please input a oushu : ")// input an even try (BufferedReader in = new BufferedReader (new InputStreamReader (System.in)) = String inputLine in.readLine () a = Integer.valueOf (inputLine). intValue ()) catch (Exception exc) ( System.out.println ( "Sorry, please input a number.") return) if (a 2%! = 0) (System.out.println ( "Sorry, please input a oushu.") return) for (b = a blt; a b) (c = (a-b) if (isPrime (b) isPrime (c)) (System.out.println (a "=" b "" c) break)))) public static boolean isPrime (int k)// method used to determine whether a number is even (int a boolean true if t =
Date : 2025-12-21 Size : 1kb User : 康健伟

图论算法中必学的内容之一,希望能给学习编程的学弟学妹们有所帮助-graph algorithm will learn one of the elements in hopes of giving the incoming young men and women to learn programming help
Date : 2025-12-21 Size : 2kb User : ipkh

DL : 0
一个采用B-树数据结构制作的图书馆管理程序,功能较简单,适合大学生数据结构参考使用-use a B-tree data structures produced by the library management procedures and functions than simple data structure suitable for college students to use reference
Date : 2025-12-21 Size : 6kb User : 吴晓辉

c 语言开发b-tree数据文件索引 .zip -b-tree data files Index c language b-tree index data files. Z IPS language b-tree index data files. zipc language b-tree data files Index . zip
Date : 2025-12-21 Size : 15kb User : 唐颖

数论算法库 C++ 语言实现 代码内容 数论算法库,包括以下算法: 欧几里德算法求a,b的最大公倍数 扩展的欧几里德算法,求出gcd(a,b)和满足gcd(a,b)=ax+by的整数x和y 求解模线性方程 ax ≡ b (mod n) 其中n>0 求解模线性方程组(中国余数定理) 模取幂运算 计算a^b mod n (a,b可能很大) Miller-Rabin随机性素数测试算法 -Number theory algorithms library C++ Language content code number theory algorithm library, which includes the following algorithms: Euclidean algorithm for a, b of the largest common multiple extended Euclidean algorithm, to derive gcd (a, b) and to meet gcd (a, b) = ax+ by the integer x and y-mode linear equations to solve ax ≡ b (mod n) in which n> 0 solving mode of linear equations (China remainder theorem) mode calculation computing exponentiation a ^ b mod n (a, b may be a lot) Miller-Rabin random prime number testing algorithm
Date : 2025-12-21 Size : 9kb User : henry

ASP.NET C#编写网站的教程,使用B/S架构,对开始接触asp.net的人很有帮助-prepared for the guidance, the use of B/S structure, had contact with the right people Asp. net helpful
Date : 2025-12-21 Size : 158kb User : zuoyinbo

(1)功能模块: A :个人开户功能 B :查询功能 查询个人用户信息 查询各个房间使用信息 查询寄存物品信息 C :增加寄存物品模块 用JAVA实现宾馆客房管理系统-(1) functional modules: A: Personal accounts functions of B: the inquiry of individual users query information in various information storage room to use items of information C: increase the storage module used items JAVA realize hotel rooms management system
Date : 2025-12-21 Size : 279kb User : 张晓娟

三次B样条插值曲面及其实现::目前在CAM/CAM的自由曲面构造方法中,较流行的有B样条曲面,Bezier曲面、Ball曲面等方法,但由这几种方法和成都是拟合曲面,而百插值曲面,常常不能满足一些工程实际中严格插值的要求,本文构造了一种自由插值曲面生成方法-B样条母线法,所生成曲面达到C^2级光滑,适用机械,模具、汽车、造船等制造加工行业的复杂曲面设计。-Three B-spline interpolation surface and realize:: At present CAM/CAM method of constructing the free-form surfaces, the more popular has B-spline surfaces, Bezier surfaces, Ball surfaces and so on, but by the several methods and Chengdu is surface fitting, and interpolation surface hundred, and often can not meet a number of engineering practice, the requirements of strict interpolation, this paper constructed a free interpolation surface generation method-B-spline busbar law, generated by C ^ 2 surface to achieve a smooth level applicable to machinery, tooling, automotive, shipbuilding and other manufacturing industries processing complex surface design.
Date : 2025-12-21 Size : 135kb User : ttcorner

DL : 0
利用C++解决CAGD中的连续的三次B样条插值问题-The use of C++ Solution CAGD in three consecutive B-spline interpolation
Date : 2025-12-21 Size : 1kb User : 形成

DL : 0
1.c企业发放的奖金根据利润提成。 2.c 计算器 3.c 班级通信录 4.c 求x的y方的低三位值 5.c a b 两数组分别正逆序相加-1.c enterprises bonuses paid under the profit percentage. 2.c Calculator 3.c class communications recorded 4.c of y for x 3 the value of the low side 5.cab reverse the two arrays are the sum of the respective
Date : 2025-12-21 Size : 5kb User : yuyu

DL : 0
VCL组件的库包BPL文件(Borland Package Library)是否能够向ActiveX一样, 在脱离任何辅助文件的情况下使用?也就是在没有相关的.h、.bpi和.lib等文 件的支持下,是否也能使用,答案是肯定的,甚至是不在IDE中也能够载入bpl 并创建其中的对象和使用之,作个简单的试验便知道,编制一个包含任意用户 组件的bpl,然后复制到另一个与之无关的C++ Builder环境中,IDE能够载入, 并且能够创建设计时对象,修改属性,但是程序不能编译通过,因为编译器需 要关于组件的预定义头文件。因此可以肯定bpl文件本身是完整的,它包含了所 有运行时需要的信息。
Date : 2025-12-21 Size : 136kb User : 吴松

驱动程序,Ambient网达MD5628D-L-C调制解调器最新驱动3.30版For Win9x/ME/2000/XP(2005年10月20日新增)-Driver, Ambient Network Tatsu MD5628D-LC driver modem the latest 3.30 version of For Win9x/ME/2000/XP (2005 on 10 years 20 day new)
Date : 2025-12-21 Size : 846kb User : qq

DL : 0
通过用B树建立索引的源代码,玩玩而已的,不成可以作为参考的-By using B tree indexing the source code, play it, and not as a reference
Date : 2025-12-21 Size : 2kb User : 程明

DL : 0
B+树实现代码,C++实现插入,删除等功能-B+ tree implementation code, C++
Date : 2025-12-21 Size : 224kb User : 笑语

C#实现多窗口互相通信,在A窗体中打开B窗体实现AB窗体之间数据的传递(C# implementation of multi window communication)
Date : 2025-12-21 Size : 101kb User : 小朋友121

三甲医院管理系统HIS(C#版),B/S结构(HIS (C# Edition) of Third-Class A Hospital Management System)
Date : 2025-12-21 Size : 9.84mb User : `bmwangrf
« 12 3 4 5 6 7 8 9 10 ... 22 »
CodeBus is one of the largest source code repositories on the Internet!
Contact us :
1999-2046 CodeBus All Rights Reserved.