The following program uses the same argument and parameter names in both the calling and called functions. Determine whether doing so causes any problem for the compiler.
#include <iostream>
using namespace std;
void time(int&, int&); // function prototype
int main()
{
int min, hour;
cout << "Enter two numbers :";
cin >> min >> hour;
time(min, hour);
return 0;
}
void time(int& min, int& hour) // accept two references
{
int sec;
sec = (hour * 60 + min) * 60;
cout << "The total number of seconds is " << sec << endl;
}
I need some help creating a modularized JavaScript roll-over function for gallery images that functions correctly and permits additions of images without the need to hard-code the values. I believe the preload is working as it should, but I haven't quite connected all of the dots for the rollover as described below.
Hint: Preloading your images will only work on a hosting server and not your local drive as there’s no load time for your images locally. Once you have preloaded those images, you may want to clear your cache to test your loading of the images again.
Tip: In a smaller JavaScript program such as this one, each function is created for a specific purpose. However, in more complex sites, it is better to build functions that we can apply to multiple situations. For example, rather than specifying an element name or id, we can use a variable that is passed into the function.
Directions
Use the gallery.html and index.html files that you downloaded in the Zip file in Assessment 1. Create functionality using JavaScript on the following pages:
index.html
Preload the gallery images.
Create rollover functionality for each of the thumbnails in your image gallery. Use appropriate images found in the images folder.
Write developer comments to describe the variables being declared and explain the functions and logical blocks of JavaScript code pertaining to the gallery.
Make sure to do the following:
Create an onpageload function to preload all of your images.
Create a modularized rollover function for gallery images.
Here is the HTML code I have so far:
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Invitation Page</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script src="js/galleryImages.js">
//added preload for the js file preload function
preload('images/firefighter.jpg', 'images/work.jpg', 'images/silhouette.jpg', 'images/event.jpg');
</script>
</head>
<body>
<header>
<div class="top">
<a class="logo" href="index.html">CapellaVolunteers<span class="dotcom">.org</span></a>
</div>
<nav>
<ul class="topnav">
<li><a href="index.html">Home</a>
</li>
<li><a href="invitation.html">Invitation</a>
</li>
<li><a href="gallery.html" class="active">Gallery</a>
</li>
<li><a href="registration.html">Registration</a>
</li>
</ul>
</nav>
</header>
<section id="gallery">
<div class="gallery">
<a target="_blank" href="images/firefighter.jpg">
<img class="image" src="images/firefighter.jpg" alt="firefighter" width="300" height="200"> <!-- added new class image to identify the roll over event with url of the selected image -->
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="images/work.jpg">
<img class="image" src="images/work.jpg" alt="work" width="300" height="200"> <!-- added new class image to identify the roll over event with url of the selected image -->
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="images/silhouette.jpg">
<img class="image" src="images/silhouette.jpg" alt="silhouette" width="300" height="200"> <!-- added new class image to identify the roll over event with url of the selected image -->
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div class="gallery">
<a target="_blank" href="images/event.jpg">
<img class="image" src="images/event.jpg" alt="event" width="300" height="200"> <!-- added new class image to identify the roll over event with url of the selected image -->
</a>
<div class="desc">Add a description of the image here</div>
</div>
<div id="fullImage"></div> <!-- added new DIV to display full image dynamically from JS-->
</section>
<footer>This events site is for IT-FP3215 tasks.
</footer>
</body>
</html>
Here is the JS I have:
//Preload function has to be included
var images = [];
//function to preload banner images
function preloadBannerImages() {
// get the src of all banner images in document and then preload them
for (var i = 0; i < images.length; i++) {
var img = new Image();
img.src = images[i].src;
}
console.log('Preloading completed!');
}
/*Example of code from professor for this functionality
function setupRollover('img1') {
theImage.outImage = new Image();
theImage.outImage.src = theImage.src;
theImage.oumouseout = function () {
this.src = this.outImage.src;
};
}*/
//Rollover functionality using modularized code
var imageGallery = function () {
var sliderInd = 0; //defining global index to count slide images.
},
addListeners = function () {
var items = document.getElementsByClassName("image"); //getting img elements by CSS class name to register event
for (let index = 0; index < items.length; index++) {
const element = items[index];
element.addEventListener("mouseover", this.loadFullImage, false);
}
},
loadFullImage = function (event) // mouse over event handler function to load full image
{
console.log(event.target.src);
document.getElementById("fullImage").innerHTML = '<img src="' + event.target.src + '"/>'; //adding full image to DIV
},
retObject = {
//public function in return object will be exposed to other members.
init: function () {
addListeners(); // calling method to register mouse over events
}
};
Can you do this question in Python code that can be run in Onlinegdb Site?
You operate several BurgerStands distributed throughout town. Define a class named BurgerStand that has a member variable for the burger stand's id number and member variable for how many burgers that stand sold that day.
a) create a constructor that allows user of the class to initialize values for id number and for how many burgers sold that day and a destructor
b) create a function named justsold that show increments of the number of burgers the stand has sold by one. (This function will invoked each time the stand sells a burger so that you can track the total number of burgers sold by the stand. And returns the number of burgers sold.)
c) create a function that calculate the total number of burgers sold by all stands.
d) write in a data file, the list of burger stands and the total number of burgers sold by all stands.
Create a class Int based on Q 1 . Overload four integer arithmetic operators (+, -, *, and /) so that they operate on objects of type Int. If the result of any such arithmetic operation exceeds the normal range of ints
Jerri Khan Roadside Tea Stall
to the increase in the business Jerri has hired staff for various positions including cashiers and waiter to provide service round the clock.
Jerri found that it was easier to manage the shop by himself, but since the business has grown and number of staff are involved, he requires a mechanism to get a clear visibility of the day-to-day operations of the shop. He Jerri Khan established a roadside tea stall 1983. Over the years the number of customers and products have grown. Due has been recommended to put in a cheap computer with a software for the cashier’s desk.
Generally, people walk into the shop and take any available seat. The order is taken by the waiter. The customers can choose any item(s) mentioned in the menu (sample as follows).
The customers need to settle the bill as the cashier’s counter before leaving the premises. The cashier enters the items ordered by the customers into the system. This helps keep the detailed record of sales. A sample of the receipt is as follows:
You are required to write console mode applications using C Programming for the following tasks.
Task #1 Marks 10
Write a to create a catalogue of products that are sold in the shop. The situation requires that you allow Jerri to:
Make sure that the items are uniquely identifiable.
Task #2 Marks 10
Write a program for the cashier(s) to allow them to record day-to-day transaction. The program should allow the cashier to add items to invoice from the catalogue created in Task #1. The invoice should contain:
Task #3 Marks 10
Write a program that will allow Jerri to generate summarized report of the daily transaction. The report should contain following:
Task #4 Marks 10
Create user manuals to help train Jerri and the cashiers to use the system.
Describe all the programs in detail.
1.) A function you have found with a minimum of 2 local points has a minimum Write a program that finds its points using the Stochastic Gradient Descent (SGD) algorithm. 2-dimensional (on the contours of the function) and 3-dimensional (the function's on the surface) with graphics and add the graph and codes to the homework.
2.) A self-found function that adds parasites and then eliminates them. Write a program, add the graphics and codes to the homework.
1.Write a program to display 1 up to l0 horizontally(i.e separated by tab \t as well as vertically use the end line \n or endl.
2.Write a program is to find the factorial of 10!.
3. Write a program to display the reverse of a given number for example if a user enters 123 the program should display 321.
4. Develop C++ program which works class time schedule of yours?
x = std[0];
for (int j = 0; j < 10; j++){
if (std[j]<x)
x = std[j];
Write a program to evalute the series.
1+3+5+7+........+n
Write a program to evalute the series.
1+3+5+7+........+n