Tell us what’s happening:
Requirement. No.8 .
I checked and all my id’s in the .main-section match the first child’s text .
What am I missing ? All other requirements meet ,checked for typos and even tried to turn off Caps and match it letter to letter. .
Your code so far
<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<main id="main-doc">
<div class="main-sections">
<section class="main-section" id="introduction">
<header class="head-ind">introduction
</header>
<p class="main-p">
C++ is a versatile and high-performance programming language created by Bjarne Stroustrup in the 1980s as an extension of C. Known for its efficiency and object-oriented features, it is widely used in systems programming, game development, and embedded systems. C++ combines low-level control with modern programming paradigms, making it a foundational language for many applications.
</p>
<ul>
<li class="main-list">
C++ supports both low-level and high-level programming, offering control over hardware while enabling modern programming paradigms.
</li>
<li class="main-list">
it is widely used for performance-critical applications like game engines, operating systems, and real-time systems.is widely used for performance-critical applications like game engines, operating systems, and real-time systems.
</li>
</ul>
<header class="head-ind">
How to learn c++
</header>
<p class="main-p">
Learning C++ requires practice and patience. Start by understanding the basics, like syntax, variables, and data types, before moving on to object-oriented concepts such as classes and inheritance. Use online resources, tutorials, or courses, and practice by building small projects like calculators or simple games. Consistent coding and problem-solving will help you master the language over time.
</p>
<ul>
<li class="main-list">
Break down complex topics into smaller sections, starting with the basics, and practice regularly with hands-on coding exercises.
</li>
<li class="main-list">
Join coding communities, participate in challenges, and learn by solving real-world problems or contributing to open-source projects.
</li>
</ul>
<header class="head-ind">
Your first code
</header>
<div id="code-line">
<code>
<span id="var"> #include </span> <iostream>
<span id="const">using namespace std;</span>
<br>
int main() {
cout << "Hello, World!"
<br></br>
<< endl;
return 0;
}
</code>
</div>
<header class="head-ind">
Data types in C++
</header>
<p class="main-p">
A quick overview of a few C++ Data types.
</p>
<ul class="main-list">
<li><code class="data-t">int</code>: Represents integer numbers (e.g., 1, 2, 3).</li>
<li><code class="data-t">float</code>: Represents decimal numbers with single precision (e.g., 3.14).</li>
<li><code class="data-t">char</code>: Represents single characters (e.g., 'A', 'B').</li>
<li><code class="data-t">bool</code>: Represents boolean values (true or false).</li>
</ul>
</section>
<section class="main-section"id="basic_syntax">
<header class="head-ind" >
basic syntax
</header>
<p class="main-p">
Understanding the basic syntax of C++ is essential for writing programs. C++ is case-sensitive and uses a structured programming approach. Every program starts with the `main()` function, and statements must end with a semicolon (`;`).
</p>
<ul>
<li class="main-list">
Programs in C++ start with preprocessor directives such as <code>#include</code> to include libraries.
</li>
<li class="main-list">
The <code>main()</code> function is where the program execution begins.
</li>
</ul>
<header class="head-ind">
Write Your First C++ Program
</header>
<div id="code-line">
<code>
<span id="var">#include</span> <iostream><br>
<span id="const">using namespace std;</span><br><br>
int main() {<br>
string name;<br>
cout << "Enter your name: ";<br>
cin >> name;<br>
cout << "Hello, " << name << "! Welcome to C++!" << endl;<br>
return 0;<br>
}
</code>
</div>
<header class="head-ind">
Key Features of C++ Syntax
</header>
<ul class="main-list">
<li><code class="data-t">Semicolons</code>: Every statement ends with a semicolon (`;`).</li>
<li><code class="data-t">Curly Braces</code>: Use `{}` to define the body of functions and control structures.</li>
<li><code class="data-t">Comments</code>: Add single-line comments using <code>//</code> and multi-line comments using <code>/* */</code>.</li>
<li><code class="data-t">Case-Sensitivity</code>: C++ is case-sensitive, so <code>main</code> and <code>Main</code> are different.</li>
</ul>
<header class="head-ind">
Example of Basic Input and Output
</header>
<p class="main-p">
In C++, you can use <code>cin</code> to take input and <code>cout</code> to display output. Below is an example:
</p>
<div id="code-line">
<code>
<span id="var">#include</span> <iostream><br>
<span id="const">using namespace std;</span><br><br>
int main() {<br>
int age;<br>
cout << "Enter your age: ";<br>
cin >> age;<br>
cout << "You are " << age << " years old.";<br>
return 0;<br>
}
</code>
</div>
</section>
<section class="main-section"id="language_use">
<header class="head-ind">language use</header>
<p class="main-p">
C++ is a powerful and versatile programming language widely used in a variety of fields due to its performance and control over system resources. Its blend of low-level and high-level capabilities makes it suitable for numerous applications, from system-level programming to complex simulations.
</p>
<ul>
<li class="main-list">
<code class="data-t">Game Development</code>: C++ is the backbone of many game engines, such as Unreal Engine, because of its high performance and real-time processing capabilities.
</li>
<li class="main-list">
<code class="data-t">Systems Programming</code>: Operating systems, device drivers, and other system-level software are often written in C++ due to its efficiency and hardware-level control.
</li>
<li class="main-list">
<code class="data-t">Embedded Systems</code>: C++ is widely used for programming microcontrollers and embedded devices, as it allows direct hardware interaction.
</li>
<li class="main-list">
<code class="data-t">Scientific Computing</code>: High-performance computing (HPC) applications and simulations in fields such as physics, chemistry, and engineering leverage C++ for its speed.
</li>
</ul>
<header class="head-ind">
Key Benefits of Using C++ in These Fields
</header>
<ul class="main-list">
<li><code class="data-t">Performance</code>: C++ delivers unparalleled speed and efficiency, crucial for resource-intensive applications like games and simulations.</li>
<li><code class="data-t">Control</code>: Its low-level features allow direct memory management and hardware interaction.</li>
<li><code class="data-t">Portability</code>: C++ applications can run on a wide range of platforms with minimal modifications.</li>
<li><code class="data-t">Rich Libraries</code>: C++ provides extensive libraries, such as STL, for tasks like data structures, algorithms, and file handling.</li>
</ul>
<header class="head-ind">
Example of a Simple C++ Use Case
</header>
<p class="main-p">
Below is an example of a simple C++ program simulating a basic banking application to demonstrate its use in financial software:
</p>
<div id="code-line">
<code>
<span id="var">#include</span> <iostream><br>
<span id="const">using namespace std;</span><br><br>
int main() {<br>
double balance, deposit;<br>
balance = 1000.50;<br><br>
cout << "Current balance: $" << balance << endl;<br>
cout << "Enter amount to deposit: ";<br>
cin >> deposit;<br>
balance += deposit;<br><br>
cout << "New balance: $" << balance << endl;<br>
return 0;<br>
}
</code>
</div>
</section>
<section class="main-section"id="variables">
<header class="head-ind">variables</header>
<p class="main-p">
Variables in C++ are placeholders for storing data that can be manipulated during program execution. Each variable in C++ has a specific type that defines the kind of data it can hold, such as integers, floating-point numbers, characters, or strings.
</p>
<ul>
<li class="main-list">
<code class="data-t">Declaration</code>: Variables must be declared with a specific type before use. For example, <code>int age;</code> declares a variable named <code>age</code> of type integer.
</li>
<li class="main-list">
<code class="data-t">Initialization</code>: Variables can be initialized during declaration or later in the program. For example, <code>int age = 25;</code>.
</li>
<li class="main-list">
<code class="data-t">Scope</code>: The scope of a variable determines where it can be accessed in the program. Variables can be local, global, or block-scoped.
</li>
<li class="main-list">
<code class="data-t">Const Variables</code>: Constants are declared using the <code>const</code> keyword and cannot be modified after initialization.
</li>
</ul>
<header class="head-ind">
Common Variable Types in C++
</header>
<ul class="main-list">
<li><code class="data-t">int</code>: Stores integer values (e.g., <code>10</code>, <code>-5</code>).</li>
<li><code class="data-t">float</code>: Stores decimal values with single precision (e.g., <code>3.14</code>).</li>
<li><code class="data-t">char</code>: Stores a single character (e.g., <code>'A'</code>, <code>'z'</code>).</li>
<li><code class="data-t">string</code>: Stores sequences of characters (e.g., <code>"Hello"</code>).</li>
<li><code class="data-t">bool</code>: Stores Boolean values (<code>true</code> or <code>false</code>).</li>
</ul>
<header class="head-ind">
Example: Using Variables in C++
</header>
<p class="main-p">
Below is an example demonstrating variable declaration, initialization, and usage in a program:
</p>
<div id="code-line">
<code>
<span id="var">#include</span> <iostream><br>
<span id="const">using namespace std;</span><br><br>
int main() {<br>
int age = 25; // Declaring and initializing an integer variable<br>
float height = 5.9; // Declaring and initializing a floating-point variable<br>
char grade = 'A'; // Declaring and initializing a character variable<br>
bool isStudent = true; // Declaring and initializing a Boolean variable<br><br>
cout << "Age: " << age << endl;<br>
cout << "Height: " << height << " feet" << endl;<br>
cout << "Grade: " << grade << endl;<br>
cout << "Student Status: " << (isStudent ? "Yes" : "No") << endl;<br><br>
return 0;<br>
}
</code>
</div>
<header class="head-ind">
Best Practices for Variables
</header>
<ul class="main-list">
<li>Use meaningful names for variables to improve code readability (e.g., <code>userAge</code> instead of <code>a</code>).</li>
<li>Initialize variables before using them to avoid unexpected behavior.</li>
<li>Choose appropriate data types to optimize memory usage and performance.</li>
</ul>
</section>
<section class="main-section"id="constants">
<header class="head-ind">constants</header>
<p class="main-p">
Constants in C++ are used to define values that do not change during the program's execution. They are typically used to improve code readability, maintainability, and avoid accidental modifications of critical values.
</p>
<ul>
<li class="main-list">
<code class="data-t">const Keyword</code>: Constants are declared using the <code>const</code> keyword. For example: <code>const int maxValue = 100;</code>.
</li>
<li class="main-list">
<code class="data-t">Literal Constants</code>: Values directly written into the code, such as numbers (<code>10</code>), characters (<code>'A'</code>), or strings (<code>"Hello"</code>).
</li>
<li class="main-list">
<code class="data-t">Enumerations</code>: A set of named constants, defined using the <code>enum</code> keyword. For example: <code>enum Color {Red, Green, Blue};</code>.
</li>
<li class="main-list">
<code class="data-t">const with Pointers</code>: Constants can also apply to pointers, either as the value the pointer points to or the pointer itself.
</li>
</ul>
<header class="head-ind">
Example: Using Constants in C++
</header>
<p class="main-p">
Below is an example demonstrating the usage of constants:
</p>
<div id="code-line">
<code>
<span id="var">#include</span> <iostream><br>
<span id="const">using namespace std;</span><br><br>
int main() {<br>
const double pi = 3.14159; // Constant for the value of Pi<br>
const int maxStudents = 30; // Maximum number of students<br><br>
cout << "The value of Pi is: " << pi << endl;<br>
cout << "Maximum students allowed: " << maxStudents << endl;<br><br>
return 0;<br>
}
</code>
</div>
<header class="head-ind">
Best Practices for Using Constants
</header>
<ul>
<li class="main-list">Use meaningful names for constants to improve code readability (e.g., <code>pi</code>, <code>maxStudents</code>).</li>
<li class="main-list">Prefer constants over hardcoded values to make the code easier to maintain.</li>
<li class="main-list">Use <code>constexpr</code> for compile-time constants when appropriate.</li>
</ul>
</section>
</div>
<div class="nav-bar">
<nav id="navbar">
<header id="nav-h">
C++ Documentation
</header>
<section class="header-box" id="intro-a">
<a class="nav-link" href="#introduction">Introduction</a>
</section>
<section class="header-box" id="basic-a">
<a class="nav-link" href="#basic_syntax">Basic syntax</a>
</section>
<section class="header-box" id="language-a">
<a class="nav-link" href="#language_use">Language Use</a>
</section>
<section class="header-box" id="variables-a">
<a class="nav-link" href="#variables">Variables</a>
</section>
<section class="header-box" id="constants-a">
<a class="nav-link" href="#constants">Constants</a>
</section>
</nav>
</div>
</main>
</body>
<script>
</script>
</html>
/* file: styles.css */
Your browser information:
User Agent is: Mozilla/5.0 (iPad; CPU OS 17_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.154 Mobile/15E148 Safari/604.1
Challenge Information:
Technical Documentation Page - Build a Technical Documentation Page