Объяснение:
using System;
namespace ConsoleApp4
{
class Program
{
static void Main(string[] args)
{
try
{
double FirstNumber = double.Parse(Console.ReadLine()); // Считываем первое число
string Action = Console.ReadLine(); // Считываем действие
double SecondNumber = double.Parse(Console.ReadLine()); // Считываем второе число
double Result = 0; // Переменная под результат
switch(Action) // В зависимости от символа действия делаем вычисление
{
case "+": { Result = FirstNumber + SecondNumber; break; } // Сложение
case "-": { Result = FirstNumber - SecondNumber; break; } // Вычитание
case "*": { Result = FirstNumber * SecondNumber; break; } // Умножение
case "/": { Result = FirstNumber / SecondNumber; break; } // Деление
default: { throw new Exception("Действие не найдено"); } // Если ввели что-то не то
}
Console.WriteLine(Result.ToString()); // Выводим результат
}
catch(Exception e)
{
Console.WriteLine("Упс! Что-то пошло не так.\n" + e);// Выводим реакцию на ошибку
}
Console.ReadLine();
}
}
}
QPython+SL4A:
import android
import time
import sys, select, os #for loop exit
#Initiate android-module
droid = android.Android()
#notify me
droid.makeToast("fetching GPS data")
print("start gps-sensor...")
droid.startLocating()
while True:
#exit loop hook
if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
line = input()
print("exit endless loop...")
break
#wait for location-event
event = droid.eventWaitFor('location',10000).result
if event['name'] == "location":
try:
#try to get gps location data
timestamp = repr(event['data']['gps']['time'])
longitude = repr(event['data']['gps']['longitude'])
latitude = repr(event['data']['gps']['latitude'])
altitude = repr(event['data']['gps']['altitude'])
speed = repr(event['data']['gps']['speed'])
accuracy = repr(event['data']['gps']['accuracy'])
loctype = "gps"
except KeyError:
#if no gps data, get the network location instead (inaccurate)
timestamp = repr(event['data']['network']['time'])
longitude = repr(event['data']['network']['longitude'])
latitude = repr(event['data']['network']['latitude'])
altitude = repr(event['data']['network']['altitude'])
speed = repr(event['data']['network']['speed'])
accuracy = repr(event['data']['network']['accuracy'])
loctype = "net"
data = loctype + ";" + timestamp + ";" + longitude + ";" + latitude + ";" + altitude + ";" + speed + ";" + accuracy
print(data) #logging
time.sleep(5) #wait for 5 seconds
print("stop gps-sensor...")
droid.stopLocating()
Поделитесь своими знаниями, ответьте на вопрос:
Какой объем информации передается за 5 мин. 13 сек., при скорости передачи информации 8кбит/с