5.18上午

First computer (Never built)

1840's 

Charles Babbage - Analytical Engine (also smaller Difference Engine)
First general purpose computer with CPU and main memory,programmed by punch cards.
However it was never built.
Today there are efforts to build the analytical engine.
The Difference Engine 2 has been built.  We saw a video of the Difference Engine 2.

Ada Lovelace wrote a program for Babbage's analytical engine.  Her program specified how the
engine should compute the Bernoulli numbers.

We talked about the Bernoulli numbers, the linear coefficients in the polynomial formulae
for the sums of the powers of the integers.

So, Ada Lovelace is often considered as the first computer programmer, because she wrote the
first detailed programming description for a general purpose computer.

The analytical engine was purely mechanical, however it was a digital computer (not analog).

---------

Electronic computers were developed in 1935 to 1940.  There were other electric computers
before ENIAC, but ENIAC was probably the first really recognizable general purpose computer.
Programs were written on punch cards in basically machine code.  In 1980 the C programming
language was developed by Ken Thompson and Dennis Richie at Bell Labs.  C was the most popular
of the very first high level languages.  Most modern procedural languages, including Java
borrow heavily from C syntax.  Java was developed in 1995 by James Gosling at Sun Microsystems.
Later Java was purchased from Sun by Oracle.  The current version of Java is version 8.

----------

What is a data structure/type/struct?
A class is like a data structure with methods.  So the class associates related data like
a struct, but it also associates the procedural code that operates on that data.  So, there
is a logical grouping of data and procedural code (variables and methods together).

So, we implemented a Fraction class, with two add methods.

We used method overloading to create one static add and one instance add method.

We implemented a constructor for the Fraction class.  The constructor has the same name as the class.  The constructor
has no return type.  For our Fraction class, we implemented a single constructor that takes 2 parameters, a numerator
and a denominator.  The constructor sets this.numerator = n and this.denominator = d  (n and d are the paramters to the constructor).  The "this" keyword refers to the newly constructed instance of the class.  So we can say

Fraction A = new Fraction(5,3);
Fraction B = new Fraction(1,3);

Fraction sum = Fraction.add(A,B);  // using the static add method

// OR

Fraction sum = A.add(B);  // using the add instance method

Also, we looked at the math.BigInteger class for large number calculations.

So, some important concepts are:

class

object / instance

variable


method

static

method overloading

declaration

initial value

转载于:https://www.cnblogs.com/bgd140201228/p/6873155.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值