1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Lady bird [3.3K]
2 years ago
12

A. Modify the FitnessTracker class that includes data fields for a fitness activity, the number of minutes spent participating,

and the date. The class includes methods to get each field. In addition, create a default constructor that automatically sets the activity to running, the minutes to 0, and the date to January 1 of the current year. Create an application that demonstrates each method works correctly.
b. Create an additional overloaded constructor for the FitnessTracker class you created in Exercise 3a. This constructor receives parameters for each of the data fields and assigns them appropriately. Add any needed statements to the TestFitnessTracker.java application to ensure that the overloaded constructor works correctly, save it, and then test it.


An example of what it should look like:

running 0 minutes on 2021-01-01

bicycling 35 minutes on 2020-08-20


What's done:

import java.time.*;

public class FitnessTracker {

String activity;

int minutes;

LocalDate date;

// constructor for 3a

public FitnessTracker() {

}

// constructor for 3b

public FitnessTracker(String a, int m, LocalDate d) {

}

public String getActivity() {

}

public int getMinutes() {

}

public LocalDate getDate() {

}

}
Computers and Technology
1 answer:
Elenna [48]2 years ago
5 0

Answer:

It keeps saying servers fully loaded

Explanation:

You might be interested in
If Scheme were a pure functional language, could it include DISPLAY ? Why or why not?​
VARVARA [1.3K]

Answer:

When Scheme is a pure functional language, it cannot include the function DISPLAY. Since the pure functional languages will return the same value whenever the same expression is evaluated, and the DISPLAY would be the output and thus it cannot be part of the purely functional language. Thus in the pure functional language we can evaluate the expressions with the same arguments and it returns the same value since there is no state to change.

Explanation:

4 0
2 years ago
Question 1 of 30
Paha777 [63]
It’s exercise tax $5 tax on a cable television line

hope this helped

~ mo
7 0
2 years ago
Write a multithreaded program that generates the Fibonacci series using Pthreads thread library. This program should work as fol
Mamont248 [21]

Answer:

#include <pthread.h>

#include <stdio.h>

#include <stdlib.h>

pthread_mutex_t mutex;

int fib[10]; /* this data is shared by the thread(s) */

int in = 0;

void *genFibo(void *param); /* the thread */

int main(int argc, char *argv[])

{

   pthread_attr_t attr;  

   if (argc != 2) {

   fprintf(stderr,"usage: fibthread <integer value>\n");

   return -1;

   }

   int count = atoi(argv[1]);

   if (count < 1) {

   fprintf(stderr,"%d must be>= 1\n", count);

   return -1;

   }

   pthread_attr_init(&attr);

   // Mutex Lock

   pthread_mutex_init(&mutex, NULL);

   // each thread computes fibonacci

   for(int i = 1;i <= count;i++) {

   pthread_t thread;

   pthread_create(&thread, &attr, genFibo, (void*)i);

   pthread_join(thread, NULL);    

   }    

   // print resulting array

   for (int i = 0; i < in;i++) {

   printf("%d ", fib[i]);

   }

   printf("\n");

   pthread_mutex_destroy(&mutex);

}

void *genFibo(void *param)

{

   pthread_mutex_lock(&mutex);

   fib[in++] = fibonacci((int)param);

   pthread_mutex_unlock(&mutex);

   pthread_exit(0);

}

int fibonacci (int x)

{

   if (x <= 1) {

   return 1;

   }

   return fibonacci(x-1) + fibonacci(x-2);

}

4 0
3 years ago
_____________technique can be used to create smooth animations or to display one of severalimages based on the requirement.
kozerog [31]

Answer: Image preloading

Explanation:

The Image Preloading process  can be describes as follows:

1. Using the new keyword an instance of the image object is created.

2. The src property and the flename of the image is set be equal.

3. Then image is downloaded into the cache with displaying it.

4. The src property is set equal to the prefetched image when it is required to display the image.

3 0
3 years ago
Which object that connects parts of a network can cause short connections due to the deterioration of the outer coming
motikmotik

Answer:

The connecting cables

Explanation:

A network is a collection of end systems and other nodes in which links are connected so as to enable communication between the end systems.

The cable is a very vital element of a network, most especially in wired networks. The cable always has an outer shield that serves the purposes of protecting the cable itself and the users. If the covering of this cable deteriorates, it can cause a bridge or a short circuit in the network.

6 0
2 years ago
Other questions:
  • Lesson 1 (4.0 points)
    13·2 answers
  • _____ refers to unsolicited commercial emails, usually sent to a large number of people with little regard to the users interest
    14·1 answer
  • Why you should care about copyright
    13·1 answer
  • Write a python program that requests a word (with lowercase letters) as input and translates the word into pig latin. The rules
    15·2 answers
  • It is important to use as much text as possible in a presentation. <br> a. True<br> b. False
    9·1 answer
  • What is the value of the result after the following statement is executed? int result = 2 + 3 + 4 ;
    7·1 answer
  • What are the names of the 3 main languages used for making websites
    10·1 answer
  • Password is an example of an authentication mechanisms that is based on " what an entity has".
    6·2 answers
  • Write any four difference between email and effects​
    14·1 answer
  • Me inculparon de crear una cuenta en Facebook y colocaron el barrio donde vivo, ¿cómo podría demostrar lo contrario? Ayuda urgen
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!