E81 CSE 131 Study Guide - Midterm Guide: Nan, Boolean Data Type

262 views1 pages
magentarat813 and 20 others unlocked
E81 CSE 131 Full Course Notes
8
E81 CSE 131 Full Course Notes
Verified Note
8 documents

Document Summary

Int pennies = 789321; int dollars = pennies/100; int cents = pennies % 100; // import cse131. argsprocessor; i(cid:374)t (cid:894)(cid:374)a(cid:373)e(cid:895) = ap. (cid:374)exti(cid:374)t(cid:894)(cid:862)(cid:894)pro(cid:373)pt(cid:895)(cid:863)(cid:895); Transcendental functions sin, cos, tan, log, exp, squrt. Random values: math. random() returns 0 <= r <= 1. Rounding: math. round(num) rounds num to nearest integer returns value of long type. Result is the more general type: double is more general than int. Example: int area = 3. 4; (not allowed) int area = (int) 3. 4; (allowed) Named after george bool (19th century logician and mathematician) !p is true if p is false is false if p is true and. P && q is true if both p and q have the value true. Works as expected for english meaning of and or. P || q is true if either p or q is true, or if both p and q are true. P || q is false only if p is false and q is false.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents