Assignment 1: Drop Lowest Grade Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It must have the following functions:
void get Score() should ask the user for a test score, store it in a reference parameter variable, and validate it. This function must be called by main once for each of the six scores to be entered (so 6 times).
Validate the test scores entered are greater than or equal to 0 and less than or equal to 100.
void calc Average() should calculate and display the average of the five highest scores. This function must be called just once by main, and must be passed the six scores.
int find Lowest() should find and return the lowest of the lowest scores passed to it. It must be called by calc Average, which uses the function to determine which of the six scores to drop.
Assignment 2: Rock, Paper, Scissors, Lizard, Spock game Write a program that will play this game against the computer. The game should end once there is a winner. If the game is a tie then the program must make the user play again, until there is a winner. Once there is a winner, the program (game) must end. When the program begins, a random number is created between 1 and 5. These values will be used as follows:
1 Rock
2 Paper
3 Scissors
4 Lizard
5 Spock
Use a menu to prompt the user for their choice, using the same values as above. The program should then display the computers choice and indicate who has won. A winner is selected using the following rules:
Scissors cut paper
Pap
er covers rock
Rock crushes lizard
Lizard poisons Spock
Spock smashes (or melts) scissors
Scissors decapitate lizard
Lizard eats paper
Paper disproves Spock
Spock vaporizes rock
Rock breaks scissors
The program must be divided into the following functions at least:
int getUserChoice()
int getComputerChoice()
void determineWinner(int, int)
void displayChoice(int)
Last Completed Projects
topic title
academic level
Writer
delivered
jQuery(document).ready(function($) {
var currentPage = 1; // Initialize current page
function reloadLatestPosts() {
// Perform AJAX request
$.ajax({
url: lpr_ajax.ajax_url,
type: ‘post’,
data: {
action: ‘lpr_get_latest_posts’,
paged: currentPage // Send current page number to server
},
success: function(response) {
// Clear existing content of the container
$(‘#lpr-posts-container’).empty();
// Append new posts and fade in
$(‘#lpr-posts-container’).append(response).hide().fadeIn(‘slow’);
// Increment current page for next pagination
currentPage++;
},
error: function(xhr, status, error) {
console.error(‘AJAX request error:’, error);
}
});
}
// Initially load latest posts
reloadLatestPosts();
// Example of subsequent reloads
setInterval(function() {
reloadLatestPosts();
}, 7000); // Reload every 7 seconds
});