Moy Ways

News Blog in 2021

  • Contact Us
  • Home
  • Business
  • Health
  • News
    • Blog
    • Entertainment
    • Misc
    • Trending
  • Pet
  • Tech

Compute the average kids per family. Note that the integers should be type cast to doubles.

November 15, 2021 by moyways Leave a Comment

Calculate the average number of kids per family. Note that the integers should be type cast to doubles. Calculate the average number of children per family. Be sure to type cast the integers to doubles.

Table of Contents

  • Average Kids Per Family
  • Answer
  • Read Also

Average Kids Per Family

import java.util.Scanner;
public class TypeCasting {
public static void main (String [] args)
{
int numKidsA = 1;
int numKidsB = 4;
int numKidsC = 5;
int numFamilies = 3;
double avgKids = 0.0;
System.out.print(“Average kids: “);
System.out.println(avgKids);
return;
}
}

"Compute

Answer

Type Casting.java
import java.util.Scanner;
public class TypeCasting {
public static void main(String[] args) {
int numKidsA = 1;
int numKidsB = 4;
int numKidsC = 5;
int numFamilies = 3;
double avgKids = 0.0;
avgKids = (numKidsA + numKidsB + numKidsC) /(double)numFamilies;
System.out.print(“kids per family: “);
System.out.println(avgKids);
return;
}
}

Read Also

How many twisted teas can get me drunk?

See also  Which molecules show an appropriate number of bonds around each carbon atom?

Filed Under: Blog

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • What is 45000 divided by 12?What is 45000 divided by 12?
    In Blog
    November 23, 2021
    What is 45000 divided by 12? Is there a website where […]
  • Vaping on a budget the ultimate guideVaping on a budget the ultimate guide
    In Entertainment
    December 24, 2021
    Vaping is the method involved with breathing in fume […]
  • why was my babysitter’s a vampire cancelled?why was my babysitter’s a vampire cancelled?
    In Blog
    November 17, 2021
    I’ve been wondering why Disney stopped making my […]
  • PokerImprove Your Poker Skills With These 4 Training Sites Run by Poker Pros
    In Entertainment
    October 1, 2022
    Poker is a game of skill and strategy. You’ll need to […]
  • Email MarketingEmail Marketing Tips for Dentists
    In Marketing
    April 1, 2022
    While most goods may now be purchased online, […]
  • What Makes ETF Funds Ethical? And How Does That Apply To You
    In Investment
    December 1, 2022
    With more and more people wanting to invest their […]
  • Promotional Items Aren’t Just For Increasing Profits
    In Business
    November 16, 2022
    Successful business owners think beyond immediate […]
  • How to Design a Flyer
    In Tips
    October 19, 2022
    Flyers are a powerful way to advertise your business. […]
  • How do game conservation laws affect hunters?How do game conservation laws affect hunters?
    In Blog
    November 12, 2021
    What impact do game conservation laws affect hunters? […]
  • The Role of Cannabis in Treating Anxiety Patients in Louisiana
    In Health
    January 20, 2023
    The medicinal benefits of marijuana are gradually […]
  • 3 Ways to Acquire Crypto Credit
    In Business
    April 27, 2022
    Cryptocurrency has been a hot commodity over the past […]
  • bank security officer? Requirements & PeculiaritiesHow to become a bank security officer? Requirements & Peculiarities
    In Tips
    June 8, 2022
    Bank security officers play a vital role in ensuring […]

Copyright © 2023 · Magazine Pro Theme on Genesis Framework · WordPress · Log in