-
Notifications
You must be signed in to change notification settings - Fork 0
/
faq.php
114 lines (86 loc) · 2.43 KB
/
faq.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
$pagetitle = 'Challenge Problems FAQ';
$pagedescription = 'Any questions you may have about how to do challenge problems';
include('includes/header.php');
?>
<!DOCTYPE html>
<html>
<head>
<title>Challenge Problems FAQ</title>
<link rel = "stylesheet" type="text/css" href="custom.css" />
</head>
<body>
<h1>Challenge Problem Frequently Asked Questions</h1>
<h3> Input and Output Format: </h3>
<h4>   For Input: Use a scanner </h5>
<h4>   For Output: Use a print statement to print information to the screen. </h5>
<pre>
<code>
<i>
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args) {
Scanner in = new Scanner(System.in); <b> // This is input </b>
System.out.println("Please Print out your first name..."); <b> // This is output </b>
String fname = in.next();
;}
}
</i>
</code>
</pre>
<br>
<h3> Common Bugs: </h3>
<ul>
<p> Make sure to only output the solution. Do not include any System.out.println() statements unless it's a part of the answer.</p>
<p> Do not include any package statements at the top of your class</p>
<p> Make sure your class is named correctly</p>
</ul>
<br>
<h3> Here is a common error you may encounter: </h3>
<ul>
<p> <b> Runtime Error: </b> This commonly occurs with <i> IndexOutOfBounds </i> exceptions where the index of the String or an array does not exist. </p>
</ul>
<br>
<h2> Here is an example piece of code for Java, Python, and C++ </h2>
<h3> Java: </h3>
<pre>
<code>
import java.util.Scanner;
public class PRB1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int x = in.nextInt();
System.out.print(x*3);
}
}
</code>
</pre>
<h3> Python: </h3>
<pre>
<code>
x = input();
print(int(x)*3);
</code>
</pre>
<h3> C++: </h3>
<pre>
<code>
#include <iostream>
using namespace std;
int main()
{
int firstNumber, sumOfTwoNumbers;
cout << "";
cin >> firstNumber;
// sum of two numbers in stored in variable sumOfTwoNumbers
sumOfTwoNumbers = firstNumber + firstNumber + firstNumber;
// Prints sum
cout << sumOfTwoNumbers;
}
</code>
</pre>
<br>
<h4> If you have any other questions, feel free to email the officers at <i>[email protected] </i></h4>
</body>
</html>
<?php include('includes/footer.php'); ?>