E

@Ekwegbalum_Unachukwu_MNSU_EDU

EE245 EXAM4_1 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; double geometricSum(double a, double x, int n) { double sum = 0.0; double power = 1.0 / x; // Start from x^(-1) for (int i = 0; i <= n; ++i) { sum += a * power; power *= x; // Next: x^(i - 1 + 1) = x^i

EE245 EXAM4_1 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; struct Node { float* data; // pointer to a float Node* left; Node* right; }; // Create a new node

EE245 EXAM3_2 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; // Binary search function: returns the index of target or -1 if not found int binarySearch(int arr[], int size, int target) { int left = 0; int right = size - 1; while (left <= right) {

EE245 EXAM3 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; // Node class with encapsulated data and accessor methods class Node { private: int data; Node* left; Node* right;

EE245 HW3 E.Unachukwu

C++
1 year ago
#include <iostream> #include <string> // Class to analyze letter statistics in a string class letter_stats { private: char letter1, letter2; // Two character variables std::string text; // String variable public:

CIS 224 Assignment 2 from Lab 2_Bag by E.E.Unachukwu

C
1 year ago
#include <stdio.h> #include<stdlib.h> /* //Author Ekwegbalum Unachukwu //Tech ID 15846083 //Lab 2 assignment 2 //Due date: January 31st, 2025 //Lab 2

CIS 224_Lab 2 practice by E.E.Unachukwu

C
1 year ago
#include <stdio.h> #include<stdlib.h> /* //Lab 2 //********ARRAY*************** //*** Array to store the muiptle variables in the single variables //Syntax; Datatype arrayname[Length_of_the_ array]= (element1 and element2,....);

testrun_forloop

C++
1 year ago
#include <iostream> int main() { int sum = 0; for (int i = -100; i <= 100; ++i) sum += i; std::cout << sum << std::endl; return 0; }

Variable practice 1

C++
1 year ago
#include <iostream> int main() { std::cout<<"Enter two numbers:"<<std::endl; int V1 = 0, V2 = 0; std::cin>>V1 >> V2; std::cout << "the sum of " << V1 << " and " << V2 << " is "<< V1 + V2 << std::endl; return 0; }

Lab 1 CIS 224 assignment

C
1 year ago
#include <stdio.h> // Function to find the next largest number greater than A and B that is divisible by B int nextLargestDivisible(int A, int B) { int integer = (A > B) ? A + 1 : B + 1; // Start with the larger of (A + 1) or (B + 1) while (integer % B != 0) { // Keep incrementing until divisible by B integer++;

CIS 224 lab 1.4 E.Unachukwu

C
1 year ago
#include <stdio.h> int main() { int score; printf(" Enter the score of the test to recieve a grade of the test\n"); scanf("%d",&score);

Refresher

C
1 year ago
//Calculate the sum of numbers #include <stdio.h> int calculateSum(int a, int b){ return a + b; } int main() { int a = 5;

HW 1_3 EE245 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; // Structure to hold coordinate data struct Coordinate { double x; double y; }; int main() {

HW 1_2 EE245 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; int main() { cout << "If this text"; cout << endl; cout << "you can pat yourself \\n on"; cout << " the back!" << endl; return 0; }

EE245 HW1_1 E.Unachukwu

C++
1 year ago
#include <iostream> using namespace std; int main() { int height; // Prompt the user for input cout << "Enter an integer (3-25):\n ";//print out instruction for the user cin >> height;

EE245 Lab0_1 by E.Unachukwu

C++
1 year ago
#include <iostream> #include<string> std::string s = "Hello"; std::string t = "World"; char c; int main() { std::cout << s + ' '+ t + '\n'; c = t[2];//t = 'r'

CIS 122_Bag2 by E.E.Unachukwu

C
2 years ago
#include <stdio.h> #include <stdlib.h> #define MAX_SIZE 100 typedef struct { int data[MAX_SIZE]; // Array to store the elements int size; // Current number of elements in the Bag } Bag;

CIS 122_Bag by E.E.Unachukwu

Python
2 years ago
class Bag: def __init__(self): self.data = [] # Initialize an empty list to store elements def add(self, item): self.data.append(item) # Add item to the list def get_current_size(self): return len(self.data) # Return the current number of elements

CIS 122_Bag by E.E.Unachukwu

Java
2 years ago
import java.util.*; import java.lang.*; import java.io.*; public class Bag { private List<Integer> data; // Declare a List to store elements private int maxSize; public Bag(int maxSize) { this.data = new ArrayList<>(); // Initialize the List

CIS 122_Bag by E.E.Unachukwu

C
2 years ago
#include <stdio.h> #include <stdlib.h> #define MAX_SIZE 50 // Define a structure for the Bag typedef struct { int data[MAX_SIZE]; // Array to store the elements int size; // Current number of elements in the Bag } Bag;